|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprocope.tools.Tools
public class Tools
Contains helper methods used throughout the whole library.
This class is not instantiatable.
Field Summary | |
---|---|
static String |
CALCULATORSFILE
|
static String |
CLUSTERERSFILE
|
static String |
CONFIGFILE
|
static String |
CONFIGPATH
|
static Map<String,Object> |
EMPTY_ANNOTATION_MAP
An empty, immutable map of annotations, i.e. |
static Map<String,String> |
EMPTY_STRING_MAP
An empty, immutable String => String map |
static String |
FULL_LIB_NAME
Full program string assembled from libary name and version |
static int |
GZIP_MAGIC
|
static String |
HOMEPAGE
Homepage of the library |
static String |
HOMEPAGE_DOCS
|
static String |
LIBRARY_NAME
Name of this library |
static int |
MINOVERLAP
Default minimum overlap required for two complexes to be mapped to each other |
static Random |
random
Globally used random number generator, uses a Mersenne twister |
static String |
VERSION
Current version of this library |
Method Summary | ||
---|---|---|
static double[] |
arrCopyOf(double[] original,
int newLength)
Exact copy of the Arrays#copyOf method from the Sun JRE 6.0 Copied into this project to assure Java 5.0 compatibility |
|
static float[] |
arrCopyOf(float[] original,
int newLength)
Exact copy of the Arrays#copyOf method from the Sun JRE 6.0 Copied into this project to assure Java 5.0 compatibility |
|
static int[] |
arrCopyOf(int[] original,
int newLength)
Exact copy of the Arrays#copyOf method from the Sun JRE 6.0 Copied into this project to assure Java 5.0 compatibility |
|
static
|
arrCopyOf(T[] original,
int newLength)
Exact copy of the Arrays#copyOf method from the Sun JRE 6.0 Copied into this project to assure Java 5.0 compatibility |
|
static
|
arrCopyOf(U[] original,
int newLength,
Class<? extends T[]> newType)
Exact copy of the Arrays#copyOf method from the Sun JRE 6.0 Copied into this project to assure Java 5.0 compatibility |
|
static String |
extractBaseFilename(String fullPath)
Extract the base file name (without extension) from a full path |
|
static String |
extractFilename(String fullPath)
Extracts the file name from a full path |
|
static int |
findMax(Collection<Integer> col)
Returns the maximum of a given integer collection. |
|
static String |
getTempFilename()
Returns an unused temporary file name. |
|
static boolean |
isGZIPed(String file)
Determines whether a file contains a GZIP header |
|
static Comparable |
max(Comparable first,
Comparable second)
Returns the maximum of two Comparable objects |
|
static Comparable |
min(Comparable first,
Comparable second)
Returns the minimum of two Comparable objects |
|
static Map<String,Object> |
parseAnnotations(String parse)
Parse annotations from a string coming from a network or annotations file. |
|
static void |
verifyAnnotationType(Object value)
Checks whether a given object is an Integer , a Float or
a List . |
|
static void |
writeAnnotations(Map<String,Object> annotations,
PrintWriter writer)
Writes a given annotations set to a writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MINOVERLAP
public static Random random
Mersenne twister
public static final Map<String,Object> EMPTY_ANNOTATION_MAP
public static final Map<String,String> EMPTY_STRING_MAP
public static final String LIBRARY_NAME
public static final String VERSION
public static final String FULL_LIB_NAME
public static final String HOMEPAGE
public static final String HOMEPAGE_DOCS
public static final String CONFIGPATH
public static final String CONFIGFILE
public static final String CLUSTERERSFILE
public static final String CALCULATORSFILE
public static final int GZIP_MAGIC
Method Detail |
---|
public static String extractFilename(String fullPath)
fullPath
- full path
public static String extractBaseFilename(String fullPath)
fullPath
- full path
public static Comparable min(Comparable first, Comparable second)
Comparable
objects
first
- first objectsecond
- second object
public static Comparable max(Comparable first, Comparable second)
Comparable
objects
first
- first objectsecond
- second object
public static int findMax(Collection<Integer> col)
col
- integer collection
public static String getTempFilename()
public static boolean isGZIPed(String file)
file
- path to file
public static void verifyAnnotationType(Object value) throws ProCopeException
Integer
, a Float
or
a List
. Throws an exception if not.
value
- object whose type will be checked
ProCopeException
- if the object is not an Integer, Float
or Listpublic static void writeAnnotations(Map<String,Object> annotations, PrintWriter writer)
annotations
- annotations to be writtenwriter
- the writerpublic static Map<String,Object> parseAnnotations(String parse)
parse
- string to be parsed
public static <T> T[] arrCopyOf(T[] original, int newLength)
public static <T,U> T[] arrCopyOf(U[] original, int newLength, Class<? extends T[]> newType)
public static int[] arrCopyOf(int[] original, int newLength)
public static float[] arrCopyOf(float[] original, int newLength)
public static double[] arrCopyOf(double[] original, int newLength)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |