|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.util.NumberToolkit
public class NumberToolkit
NumberToolkit.java Deals with number manipulation
Field Summary | |
---|---|
private static java.util.Random |
R
a random number generator |
Constructor Summary | |
---|---|
private |
NumberToolkit()
Creates a new instance of NumberToolkit |
Method Summary | |
---|---|
static java.lang.Object |
cloneNumber(java.lang.Object numObject)
|
static AutoMedType[][] |
createAutoMedNumberRanges(int min,
int max,
int numEqualRanges)
Devide an integer range into an equal number of disjoint, equal-sized sub-ranges |
static void |
createBinSequence(int[] binPattern,
int position,
int positions,
int length,
java.util.List seql)
Create a List of all binary sequences of n where each sequence contains exactly k ones |
static int[][] |
createNumberRanges(int min,
int max,
int numEqualRanges)
Devide an integer range into an equal number of disjoint, equal-sized sub-ranges |
static java.lang.String |
getBitString(int val)
Get the bit string of an integer value |
private static int[] |
outputBinSequence(int[] string,
int position,
int length)
Used by createBinSequence(int string[], int position, int positions, int length, List seql)
method |
static double |
parseDouble(java.lang.Object numObject)
Parse a numeric object to get double value. |
static java.lang.Number |
parseNumber(java.lang.Object numObject)
Parse a numeric object to a Number object for different usages. If the input object is null then this method returns Number 0. |
static int |
randomInt()
|
static long |
randomLong()
|
static int[][] |
toIntegerArray(AutoMedType[][] arr)
Convert a 2-dimensional AutoMedIntegerType array to integer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.Random R
Constructor Detail |
---|
private NumberToolkit()
Method Detail |
---|
public static java.lang.String getBitString(int val)
public static int[][] createNumberRanges(int min, int max, int numEqualRanges)
public static AutoMedType[][] createAutoMedNumberRanges(int min, int max, int numEqualRanges)
AutoMedType
[][] a two dimensional array with 1st dimension
containing low public static int[][] toIntegerArray(AutoMedType[][] arr)
AutoMedIntegerType
array to integer
public static void createBinSequence(int[] binPattern, int position, int positions, int length, java.util.List seql)
int[]
- an empty binary sequence array to serve as the place holder for
all sequences to be createdint
- position the index position to start in the sequenceint
- positions the number of one-positions (i.e. k)seql
- the output list which contains all k-one binary sequence created
Adapted from "Efficiently Enumerating the Subsets of a Set", URL:
http://citeseer.ist.psu.edu/529895.htmlprivate static int[] outputBinSequence(int[] string, int position, int length)
createBinSequence(int string[], int position, int positions, int length, List seql)
method
public static double parseDouble(java.lang.Object numObject)
public static java.lang.Number parseNumber(java.lang.Object numObject)
public static java.lang.Object cloneNumber(java.lang.Object numObject)
public static int randomInt()
public static long randomLong()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |