Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities
Class Util

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.Util
All Implemented Interfaces:
Loggable

public final class Util
extends AbstractLoggable


Field Summary
private static StaticLogger logger
          The logger of this class.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
private Util()
           
 
Method Summary
static void addFlag(List<String> parameters, Flag flag)
          Adds the specified flag to the beginning of the given parameter list.
static void addFlag(List<String> parameters, OptionID optionID)
          Adds the specified optionID of a flag to the beginning of the given parameter list.
static String[] addFlag(String[] parameters, Flag flag)
          Adds the specified flag to the beginning of the given parameter array.
static void addParameter(List<String> parameters, OptionID optionID, String value)
          Adds the specified optionID and its value to the beginning of the given parameter list.
static void addParameter(List<String> parameters, Parameter<?,?> parameter, String value)
          Adds the specified parameter and the specified value to the beginning of the given parameter list.
static String[] addParameter(String[] parameters, OptionID optionID, String value)
          Adds the specified optionID and its value to the beginning of the given parameter array.
static String[] addParameter(String[] parameters, Parameter<?,?> parameter, String value)
          Adds the specified parameter and its value to the beginning of the given parameter array.
static
<O extends RealVector<O,?>>
O
centroid(Database<O> database)
          Returns the centroid as a RealVector object of the specified database.
static
<V extends RealVector<V,?>>
V
centroid(Database<V> database, Collection<Integer> ids)
          Returns the centroid as a RealVector object of the specified objects stored in the given database.
static
<V extends RealVector<V,?>>
V
centroid(Database<V> database, Collection<Integer> ids, BitSet bitSet)
          Returns the centroid w.r.t. the dimensions specified by the given BitSet as a RealVector object of the specified objects stored in the given database.
static Vector centroid(Matrix data)
          Returns the centroid as a Vector object of the specified data matrix.
static double[] convertToDoubles(float[] values)
          Converts the specified array of doubles to an array of floats.
static double[] convertToDoubles(List<Double> values)
          Converts the specified list of Double objects to an array of doubles.
static float[] convertToFloat(double[] values)
          Converts the specified array of doubles to an array of floats.
static List<Float> convertToFloat(List<Double> values)
          Converts the specified list of double objects to a list of float objects.
static double[] copy(double[] array)
          Returns a new double array containng the same objects as are contained in the given array.
static String[] copy(String[] array)
          Returns a new String array containing the same objects as are contained in the given array.
static
<O extends RealVector<O,?>>
Matrix
covarianceMatrix(Database<O> database)
          Determines the covariance matrix of the objects stored in the given database.
static
<V extends RealVector<V,?>>
Matrix
covarianceMatrix(Database<V> database, Collection<Integer> ids)
          Determines the covariance matrix of the objects stored in the given database.
static Matrix covarianceMatrix(Matrix data)
          Determines the d x d covariance matrix of the given n x d data matrix.
static String format(BitSet bitSet, int dim, String sep)
          Returns a string representation of the specified bit set.
static String format(boolean b)
          Formats the boolean b.
static String format(boolean[] b, String sep)
          Formats the boolean array b with ',' as separator.
static String format(byte[] a)
          Formats the byte array a for printing purposes.
static String format(double d)
          Formats the double d with 2 fraction digits.
static String format(double[] d)
          Formats the double array d with ',' as separator and 2 fraction digits.
static String format(double[][] d)
          Formats the double array d with ',' as separator and 2 fraction digits.
static String format(double[][] d, String sep1, String sep2, int digits)
          Formats the array of double arrays d with 'the specified separators and fraction digits.
static String format(double[] d, NumberFormat nf)
          Formats the double array d with the specified number format.
static String format(double[] d, String sep)
          Formats the double array d with the specified separator.
static String format(double[] d, String sep, int digits)
          Formats the double array d with the specified separator and the specified fraction digits.
static String format(double[] d, String sep, NumberFormat nf)
          Formats the double array d with the specified number format.
static String format(double d, int digits)
          Formats the double d with the specified fraction digits.
static String format(double d, NumberFormat nf)
          Formats the double d with the specified number format.
static String format(float[] f)
          Formats the float array f with ',' as separator and 2 fraction digits.
static String format(float[] f, String sep, int digits)
          Formats the float array f with the specified separator and the specified fraction digits.
static String format(int[] a)
          Formats the int array a for printing purposes.
static String format(int[] a, String sep)
          Formats the int array a for printing purposes.
static String format(int dim, BitSet bitSet)
          Returns a string representation of the specified bit set.
static String format(long[] a)
          Formats the long array a for printing purposes.
static SortedSet<ClassLabel<?>> getClassLabels(Database<?> database)
          Retrieves all class labels within the database.
static
<O extends DatabaseObject>
Collection<Integer>
getDatabaseIDs(Database<O> db)
          Returns a collection of the ids of the objects stored in the specified database.
static String getFilePrefix(String fileName)
          Returns the prefix of the specidfied fileName (i.e. the name of the file without extension).
static int getIndexOfMaximum(double[] values)
          Returns the index of the maximum of the given values.
static
<T> T
instantiate(Class<T> type, String className)
          Returns a new instance of the given type for the specified className.
static BitSet int2Bit(int n)
          Converts the specified positive integer value into a bit representation, where bit 0 denotes 20, bit 1 denotes 21 etc.
static
<O> void
intersection(Set<O> s1, Set<O> s2, Set<O> result)
          Provides the intersection of the two specified sets in the given result set.
static
<D extends Distance<D>>
D
max(D d1, D d2)
          Returns the maximum of the given Distances or the first, if none is greater than the other one.
static double[][] min_max(Database<RealVector<?,?>> database)
          Determines the minimum and maximum values in each dimension of all objects stored in the given database.
static
<D extends Distance<D>>
D
min(D d1, D d2)
          Returns the minimum of the given Distances or the first, if none is less than the other one.
static
<O extends Option<?>>
String
optionsNamesToString(List<O> options)
          Returns a string representation of the specified list of options containing the names of the options.
static String[] parameterDifference(String[] complete, String[] part)
          Returns an array that contains all elements of the first parameter array that are not contained by the second parameter array.
static
<N extends NumberParameter<?>>
String
parameterNamesAndValuesToString(List<N> parameters)
          Returns a string representation of the list of number parameters containing the names and the values of the parameters.
static BitSet parseBitSet(char[] s)
          Returns a new BitSet initialized to the values represented by the specified char array only containing '0' and '1' values.
static BitSet parseBitSet(String s)
          Returns a new BitSet initialized to the values represented by the specified String only containing 0 and 1 values.
static double[] parseDoubles(String s)
          Returns a new Double array initialized to the values represented by the specified String and separated by comma, as performed by the valueOf method of class Double.
static float[] parseFloats(String s)
          Returns a new Float array initialized to the values represented by the specified String and separated by comma, as performed by the valueOf method of class Float.
static String parseSelectedBits(BitSet b, String sep)
          Returns a string that represents the selected bits of the specified BitSet, while the first bit starts with 1.
static
<O> void
print(List<O> list, String separator, PrintStream out)
          Prints the given list to the specified PrintStream.
static String status(Progress progress)
          Provides a status report line with leading carriage return.
static String status(Progress progress, int clusters)
          Provides a status report line with leading carriage return.
static String transposedGnuplotScript(String filename, int datasetSize, int dimensionality)
          Provides a script-text for a gnuplot script to use for transposed view of a specific file of given size of data set.
static double[] unbox(Double[] array)
          Returns the unboxed double array of the given Object Double array.
static double[] unbox(Number[] array)
          Returns the unboxed double array of the given Object Number array.
static float[] unboxToFloat(Number[] array)
          Returns the unboxed float array of the given Object Number array.
static
<O extends RealVector<O,?>>
double[]
variances(Database<O> database)
          Determines the variances in each dimension of all objects stored in the given database.
static double[] variances(Database<RealVector<?,?>> database, RealVector<?,?> centroid, Collection<Integer>[] ids)
          Determines the variances in each dimension of the specified objects stored in the given database.
static
<V extends RealVector<V,?>>
double[]
variances(Database<V> database, Collection<Integer> ids)
          Determines the variances in each dimension of the specified objects stored in the given database.
static
<V extends RealVector<V,?>>
double[]
variances(Database<V> database, V centroid, Collection<Integer> ids)
          Determines the variances in each dimension of the specified objects stored in the given database.
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static StaticLogger logger
The logger of this class.

Constructor Detail

Util

private Util()
Method Detail

max

public static <D extends Distance<D>> D max(D d1,
                                            D d2)
Returns the maximum of the given Distances or the first, if none is greater than the other one.

Parameters:
d1 - first Distance
d2 - second Distance
Returns:
Distance the maximum of the given Distances or the first, if neither is greater than the other one

min

public static <D extends Distance<D>> D min(D d1,
                                            D d2)
Returns the minimum of the given Distances or the first, if none is less than the other one.

Parameters:
d1 - first Distance
d2 - second Distance
Returns:
Distance the minimum of the given Distances or the first, if neither is less than the other one

format

public static String format(double d)
Formats the double d with 2 fraction digits.

Parameters:
d - the double to be formatted
Returns:
a String representing the double d

format

public static String format(double d,
                            int digits)
Formats the double d with the specified fraction digits.

Parameters:
d - the double array to be formatted
digits - the number of fraction digits
Returns:
a String representing the double d

format

public static String format(double d,
                            NumberFormat nf)
Formats the double d with the specified number format.

Parameters:
d - the double array to be formatted
nf - the number format to be used for formatting
Returns:
a String representing the double d

format

public static String format(double[] d)
Formats the double array d with ',' as separator and 2 fraction digits.

Parameters:
d - the double array to be formatted
Returns:
a String representing the double array d

format

public static String format(double[][] d)
Formats the double array d with ',' as separator and 2 fraction digits.

Parameters:
d - the double array to be formatted
Returns:
a String representing the double array d

format

public static String format(double[][] d,
                            String sep1,
                            String sep2,
                            int digits)
Formats the array of double arrays d with 'the specified separators and fraction digits.

Parameters:
d - the double array to be formatted
sep1 - the first separator of the outer array
sep2 - the second separator of the inner array
digits - the number of fraction digits
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            String sep)
Formats the double array d with the specified separator.

Parameters:
d - the double array to be formatted
sep - the seperator between the single values of the double array, e.g. ','
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            String sep,
                            int digits)
Formats the double array d with the specified separator and the specified fraction digits.

Parameters:
d - the double array to be formatted
sep - the seperator between the single values of the double array, e.g. ','
digits - the number of fraction digits
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            NumberFormat nf)
Formats the double array d with the specified number format.

Parameters:
d - the double array to be formatted
nf - the number format to be used for formatting
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            String sep,
                            NumberFormat nf)
Formats the double array d with the specified number format.

Parameters:
d - the double array to be formatted
sep - the seperator between the single values of the double array, e.g. ','
nf - the number format to be used for formatting
Returns:
a String representing the double array d

format

public static String format(float[] f,
                            String sep,
                            int digits)
Formats the float array f with the specified separator and the specified fraction digits.

Parameters:
f - the float array to be formatted
sep - the seperator between the single values of the float array, e.g. ','
digits - the number of fraction digits
Returns:
a String representing the float array f

format

public static String format(float[] f)
Formats the float array f with ',' as separator and 2 fraction digits.

Parameters:
f - the float array to be formatted
Returns:
a String representing the float array f

format

public static String format(int[] a,
                            String sep)
Formats the int array a for printing purposes.

Parameters:
a - the int array to be formatted
sep - the seperator between the single values of the float array, e.g. ','
Returns:
a String representing the int array a

format

public static String format(int[] a)
Formats the int array a for printing purposes.

Parameters:
a - the int array to be formatted
Returns:
a String representing the int array a

format

public static String format(long[] a)
Formats the long array a for printing purposes.

Parameters:
a - the long array to be formatted
Returns:
a String representing the long array a

format

public static String format(byte[] a)
Formats the byte array a for printing purposes.

Parameters:
a - the byte array to be formatted
Returns:
a String representing the byte array a

format

public static String format(boolean b)
Formats the boolean b.

Parameters:
b - the boolean to be formatted
Returns:
a String representing of the boolean b

format

public static String format(boolean[] b,
                            String sep)
Formats the boolean array b with ',' as separator.

Parameters:
b - the boolean array to be formatted
sep - the seperator between the single values of the double array, e.g. ','
Returns:
a String representing the boolean array b

getFilePrefix

public static String getFilePrefix(String fileName)
Returns the prefix of the specidfied fileName (i.e. the name of the file without extension).

Parameters:
fileName - the name of the file
Returns:
the prefix of the specidfied fileName

copy

public static String[] copy(String[] array)
Returns a new String array containing the same objects as are contained in the given array.

Parameters:
array - an array to copy
Returns:
the copied array

copy

public static double[] copy(double[] array)
Returns a new double array containng the same objects as are contained in the given array.

Parameters:
array - an array to copy
Returns:
the copied array

unbox

public static double[] unbox(Double[] array)
Returns the unboxed double array of the given Object Double array.

Parameters:
array - the array to be unboxed
Returns:
the unboxed double array

unbox

public static double[] unbox(Number[] array)
Returns the unboxed double array of the given Object Number array.

Parameters:
array - the array to be unboxed
Returns:
the unboxed double array

unboxToFloat

public static float[] unboxToFloat(Number[] array)
Returns the unboxed float array of the given Object Number array.

Parameters:
array - the array to be unboxed
Returns:
the unboxed float array

centroid

public static <V extends RealVector<V,?>> V centroid(Database<V> database,
                                                     Collection<Integer> ids)
Returns the centroid as a RealVector object of the specified objects stored in the given database. The objects belonging to the specified ids must be instance of RealVector.

Parameters:
database - the database storing the objects
ids - the ids of the objects
Returns:
the centroid of the specified objects stored in the given database
Throws:
IllegalArgumentException - if the id list is empty

centroid

public static <V extends RealVector<V,?>> V centroid(Database<V> database,
                                                     Collection<Integer> ids,
                                                     BitSet bitSet)
Returns the centroid w.r.t. the dimensions specified by the given BitSet as a RealVector object of the specified objects stored in the given database. The objects belonging to the specified ids must be instance of RealVector.

Parameters:
database - the database storing the objects
ids - the identifiable objects
bitSet - the bitSet specifiying the dimensions to be considered
Returns:
the centroid of the specified objects stored in the given database
Throws:
IllegalArgumentException - if the id list is empty

centroid

public static <O extends RealVector<O,?>> O centroid(Database<O> database)
Returns the centroid as a RealVector object of the specified database. The objects must be instance of RealVector.

Parameters:
database - the database storing the objects
Returns:
the centroid of the specified objects stored in the given database
Throws:
IllegalArgumentException - if the database is empty

centroid

public static Vector centroid(Matrix data)
Returns the centroid as a Vector object of the specified data matrix.

Parameters:
data - the data matrix, where the data vectors are column vectors
Returns:
the centroid of the specified data matrix

covarianceMatrix

public static <V extends RealVector<V,?>> Matrix covarianceMatrix(Database<V> database,
                                                                  Collection<Integer> ids)
Determines the covariance matrix of the objects stored in the given database.

Parameters:
database - the database storing the objects
ids - the ids of the objects
Returns:
the covarianvce matrix of the specified objects

covarianceMatrix

public static <O extends RealVector<O,?>> Matrix covarianceMatrix(Database<O> database)
Determines the covariance matrix of the objects stored in the given database.

Parameters:
database - the database storing the objects
Returns:
the covarianvce matrix of the specified objects

covarianceMatrix

public static Matrix covarianceMatrix(Matrix data)
Determines the d x d covariance matrix of the given n x d data matrix.

Parameters:
data - the database storing the objects
Returns:
the covarianvce matrix of the given data matrix.

variances

public static <O extends RealVector<O,?>> double[] variances(Database<O> database)
Determines the variances in each dimension of all objects stored in the given database.

Parameters:
database - the database storing the objects
Returns:
the variances in each dimension of all objects stored in the given database

variances

public static <V extends RealVector<V,?>> double[] variances(Database<V> database,
                                                             Collection<Integer> ids)
Determines the variances in each dimension of the specified objects stored in the given database. Returns variances(database, centroid(database, ids), ids)

Parameters:
database - the database storing the objects
ids - the ids of the objects
Returns:
the variances in each dimension of the specified objects

variances

public static <V extends RealVector<V,?>> double[] variances(Database<V> database,
                                                             V centroid,
                                                             Collection<Integer> ids)
Determines the variances in each dimension of the specified objects stored in the given database.

Parameters:
database - the database storing the objects
ids - the ids of the objects
centroid - the centroid or reference vector of the ids
Returns:
the variances in each dimension of the specified objects

variances

public static double[] variances(Database<RealVector<?,?>> database,
                                 RealVector<?,?> centroid,
                                 Collection<Integer>[] ids)
Determines the variances in each dimension of the specified objects stored in the given database.

Parameters:
database - the database storing the objects
ids - the array of ids of the objects to be considered in each diemsnion
centroid - the centroid or reference vector of the ids
Returns:
the variances in each dimension of the specified objects

min_max

public static double[][] min_max(Database<RealVector<?,?>> database)
Determines the minimum and maximum values in each dimension of all objects stored in the given database.

Parameters:
database - the database storing the objects
Returns:
an array consisting of an array of the minimum and an array of the maximum values in each dimension of all objects stored in the given database

parseDoubles

public static double[] parseDoubles(String s)
Returns a new Double array initialized to the values represented by the specified String and separated by comma, as performed by the valueOf method of class Double.

Parameters:
s - the string to be parsed.
Returns:
a new Double array represented by s

parseFloats

public static float[] parseFloats(String s)
Returns a new Float array initialized to the values represented by the specified String and separated by comma, as performed by the valueOf method of class Float.

Parameters:
s - the string to be parsed.
Returns:
a new Float array represented by s

convertToFloat

public static List<Float> convertToFloat(List<Double> values)
Converts the specified list of double objects to a list of float objects.

Parameters:
values - the list of double objects to be converted
Returns:
the converted list of float objects

convertToFloat

public static float[] convertToFloat(double[] values)
Converts the specified array of doubles to an array of floats.

Parameters:
values - the array of doubles to be converted
Returns:
the converted array of floats

convertToDoubles

public static double[] convertToDoubles(float[] values)
Converts the specified array of doubles to an array of floats.

Parameters:
values - the array of doubles to be converted
Returns:
the converted array of floats

convertToDoubles

public static double[] convertToDoubles(List<Double> values)
Converts the specified list of Double objects to an array of doubles.

Parameters:
values - the list of Double objects to be converted
Returns:
the converted array of doubles

transposedGnuplotScript

public static String transposedGnuplotScript(String filename,
                                             int datasetSize,
                                             int dimensionality)
Provides a script-text for a gnuplot script to use for transposed view of a specific file of given size of data set.

Parameters:
filename - the filename of the transposed file to be plotted
datasetSize - the size of the transposed data set
dimensionality - the dimensionality of the transposed data set
Returns:
a script-text for a gnuplot script to use for transposed view of a specific file of given size of data set

instantiate

public static <T> T instantiate(Class<T> type,
                                String className)
                     throws UnableToComplyException
Returns a new instance of the given type for the specified className.

If the Class for className is not found, the instantiation is tried using the package of the given type as package of the given className.

Parameters:
type - desired Class type of the Object to retrieve
className - name of the class to instantiate
Returns:
a new instance of the given type for the specified className
Throws:
UnableToComplyException - if the instantiation cannot be performed successfully

status

public static String status(Progress progress,
                            int clusters)
Provides a status report line with leading carriage return. Suitable for density based algorithms, since the number of found clusters is counted.

Parameters:
progress - the progress status
clusters - current number of clusters
Returns:
a status report line with leading carriage return

status

public static String status(Progress progress)
Provides a status report line with leading carriage return.

Parameters:
progress - the progress status
Returns:
a status report line with leading carriage return

print

public static <O> void print(List<O> list,
                             String separator,
                             PrintStream out)
Prints the given list to the specified PrintStream. The list entries are separated by the specified separator. The last entry is not followed by a separator. Thus, if a newline is used as separator, it might make sense to print a newline to the PrintStream after calling this method.

Parameters:
list - the list to be printed
separator - the separator to separate entries of the list
out - the target PrintStream

getIndexOfMaximum

public static int getIndexOfMaximum(double[] values)
                             throws ArrayIndexOutOfBoundsException
Returns the index of the maximum of the given values. If no value is bigger than the first, the index of the first entry is returned.

Parameters:
values - the values to find the index of the maximum
Returns:
the index of the maximum in the given values
Throws:
ArrayIndexOutOfBoundsException - if values.length==0

getClassLabels

public static SortedSet<ClassLabel<?>> getClassLabels(Database<?> database)
Retrieves all class labels within the database.

Parameters:
database - the database to be scanned for class labels
Returns:
a set comprising all class labels that are currently set in the database

parameterDifference

public static String[] parameterDifference(String[] complete,
                                           String[] part)
                                    throws IllegalArgumentException
Returns an array that contains all elements of the first parameter array that are not contained by the second parameter array. The first parameter array must at least be as long as the second. The second must not contain entries that are not contained by the first.

Parameters:
complete - the complete array
part - an array that contains only elements of the first parameter array
Returns:
an array that contains all elements of the first parameter array that are not contained by the second parameter array
Throws:
IllegalArgumentException - if the first array, complete is not as long as the second array, part or the second, part, contains entries that are not contained by the first, complete

format

public static String format(BitSet bitSet,
                            int dim,
                            String sep)
Returns a string representation of the specified bit set.

Parameters:
bitSet - the bitSet
dim - the overall dimensionality of the bit set
sep - the separator
Returns:
a string representation of the specified bit set.

format

public static String format(int dim,
                            BitSet bitSet)
Returns a string representation of the specified bit set.

Parameters:
dim - the overall dimensionality of the bit set
bitSet - the bitSet
Returns:
a string representation of the specified bit set.

parseBitSet

public static BitSet parseBitSet(String s)
Returns a new BitSet initialized to the values represented by the specified String only containing 0 and 1 values.

Parameters:
s - the string to be parsed.
Returns:
a new BitSet represented by s

parseBitSet

public static BitSet parseBitSet(char[] s)
Returns a new BitSet initialized to the values represented by the specified char array only containing '0' and '1' values.

Parameters:
s - the char array to be parsed.
Returns:
a new BitSet represented by s

parseSelectedBits

public static String parseSelectedBits(BitSet b,
                                       String sep)
Returns a string that represents the selected bits of the specified BitSet, while the first bit starts with 1. The selected bits are separated by the specified separator sep.

Parameters:
b - the bit set to be parsed
sep - the separator
Returns:
a string representing the selected bits of the specified BitSet

intersection

public static <O> void intersection(Set<O> s1,
                                    Set<O> s2,
                                    Set<O> result)
Provides the intersection of the two specified sets in the given result set.

Parameters:
s1 - the first set
s2 - the second set
result - the result set

int2Bit

public static BitSet int2Bit(int n)
Converts the specified positive integer value into a bit representation, where bit 0 denotes 20, bit 1 denotes 21 etc.

Parameters:
n - the positive integer value to be converted
Returns:
the specified integer value into a bit representation

getDatabaseIDs

public static <O extends DatabaseObject> Collection<Integer> getDatabaseIDs(Database<O> db)
Returns a collection of the ids of the objects stored in the specified database.

Parameters:
db - the database storing the objects
Returns:
a collection of the ids of the objects stored in the specified database

addFlag

public static String[] addFlag(String[] parameters,
                               Flag flag)
Adds the specified flag to the beginning of the given parameter array.

Parameters:
parameters - the array of parameters
flag - the flag to be added
Returns:
a new parameter array containing the values of parameters and the specified flag.

addParameter

public static String[] addParameter(String[] parameters,
                                    Parameter<?,?> parameter,
                                    String value)
Adds the specified parameter and its value to the beginning of the given parameter array.

Parameters:
parameters - the array of parameters
parameter - the parameter to be added
value - the value of the parameter to be added
Returns:
a new parameter array containing the values of parameters and the specified parameter and its value.

addParameter

public static String[] addParameter(String[] parameters,
                                    OptionID optionID,
                                    String value)
Adds the specified optionID and its value to the beginning of the given parameter array.

Parameters:
parameters - the array of parameters
optionID - the optionID to be added
value - the value of the optionID to be added
Returns:
a new parameter array containing the values of parameters and the specified optionID and its value.

addFlag

public static void addFlag(List<String> parameters,
                           Flag flag)
Adds the specified flag to the beginning of the given parameter list.

Parameters:
parameters - the list of parameters
flag - the flag to be added

addFlag

public static void addFlag(List<String> parameters,
                           OptionID optionID)
Adds the specified optionID of a flag to the beginning of the given parameter list.

Parameters:
parameters - the list of parameters
optionID - the optionID to be added

addParameter

public static void addParameter(List<String> parameters,
                                OptionID optionID,
                                String value)
Adds the specified optionID and its value to the beginning of the given parameter list.

Parameters:
parameters - the list of parameters
optionID - the optionID of the parameter to be added
value - the value of the parameter to be added

addParameter

public static void addParameter(List<String> parameters,
                                Parameter<?,?> parameter,
                                String value)
Adds the specified parameter and the specified value to the beginning of the given parameter list.

Parameters:
parameters - the list of parameters
parameter - the parameter to be added
value - the value of the parameter to be added

optionsNamesToString

public static <O extends Option<?>> String optionsNamesToString(List<O> options)
Returns a string representation of the specified list of options containing the names of the options.

Parameters:
options - the list of options
Returns:
the names of the options

parameterNamesAndValuesToString

public static <N extends NumberParameter<?>> String parameterNamesAndValuesToString(List<N> parameters)
Returns a string representation of the list of number parameters containing the names and the values of the parameters.

Parameters:
parameters - the list of number parameters
Returns:
the names and the values of the parameters

Release 0.1 (2008-07-10_1838)