All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.hdf.util.Tools
java.lang.Object
|
+----ncsa.hdf.util.Tools
- public class Tools
- extends Object
-
debug
-
-
Tools()
-
-
double2byte(double[])
- convert a double to a byte array
-
getKey()
- return a unique string key.
-
getRange(byte[])
- find the maximum and the minimum in a byte array
-
getRange(byte[], int, int)
- find the maximum and the minimum in a byte array
-
getRange(double[])
- find the maximum and the minimum in a double array
-
getRange(double[], int, int)
- find the maximum and the minimum in a double array
-
getRange(float[])
- find the maximum and the minimum in a float array
-
getRange(float[], int, int)
- find the maximum and the minimum in a float array
-
getRange(int[])
- find the maximum and the minimum in a int array
-
getRange(int[], int, int)
- find the maximum and the minimum in a int array
-
getRange(long[])
- find the maximum and the minimum in a long array
-
getRange(long[], int, int)
- find the maximum and the minimum in a long array
-
getRange(Object)
- find the maximum and the minimum of an array
-
getRange(Object, int, int)
- find the maximum and the minimum of an array
// does not work correctly for irix machines
-
getRange(short[])
- find the maximum and the minimum in a short array
-
getRange(short[], int, int)
- find the maximum and the minimum in a short array
-
main(String[])
- for testing purpose only
-
mean(Object)
- calculate the mean value of an array
-
mean(Object, int, int)
- calculate the mean value of an array
-
notFalse(boolean)
-
-
notFalse(boolean, String)
-
-
notNull(Object)
-
-
notNull(Object, String)
-
-
sort(Object)
- Sort an array in ascending order with insert sort
-
sort(String[])
- Sort an array of strings with insert sort
-
var(Object)
- calculate the variance of an array
-
var(Object, int, int)
- calculate the variance of an array
debug
public static boolean debug
Tools
public Tools()
getKey
public static synchronized String getKey()
- return a unique string key. This method is synchronized.
Only one thread calls it a time to make the key unique.
- Returns:
- The string key
notFalse
public static void notFalse(boolean b) throws IllegalArgumentException
notNull
public static void notNull(Object obj) throws IllegalArgumentException
notFalse
public static void notFalse(boolean b,
String s) throws IllegalArgumentException
notNull
public static void notNull(Object obj,
String s) throws IllegalArgumentException
sort
public static void sort(Object array)
- Sort an array in ascending order with insert sort
- Parameters:
- array - the data array to be sorted
sort
public static void sort(String a[])
- Sort an array of strings with insert sort
double2byte
public static byte[] double2byte(double data[])
- convert a double to a byte array
- Parameters:
- data - The input double array
- Returns:
- The byte array
mean
public static double mean(Object data)
- calculate the mean value of an array
- Parameters:
- data - The data array
- Returns:
- The mean value
mean
public static double mean(Object data,
int low,
int high)
- calculate the mean value of an array
- Parameters:
- data - The data array
- low - The starting index
- high - The ending index
- Returns:
- The mean value
var
public static double var(Object data)
- calculate the variance of an array
- Parameters:
- data - The data array
- Returns:
- The variance
var
public static double var(Object data,
int low,
int high)
- calculate the variance of an array
- Parameters:
- data - The data array
- low - The starting index
- high - The ending index
- Returns:
- The variance
main
public static void main(String argv[])
- for testing purpose only
getRange
public static double[] getRange(double data[])
- find the maximum and the minimum in a double array
- Parameters:
- data - The input double array
- Returns:
- The max and min data
getRange
public static float[] getRange(float data[])
- find the maximum and the minimum in a float array
- Parameters:
- data - The input float array
- Returns:
- The max and min data
getRange
public static long[] getRange(long data[])
- find the maximum and the minimum in a long array
- Parameters:
- data - The input long array
- Returns:
- The max and min data
getRange
public static int[] getRange(int data[])
- find the maximum and the minimum in a int array
- Parameters:
- data - The input int array
- Returns:
- The max and min data
getRange
public static byte[] getRange(byte data[])
- find the maximum and the minimum in a byte array
- Parameters:
- data - The input byte array
- Returns:
- The max and min data
getRange
public static short[] getRange(short data[])
- find the maximum and the minimum in a short array
- Parameters:
- data - The input byte array
- Returns:
- The max and min data
getRange
public static double[] getRange(double data[],
int low,
int high)
- find the maximum and the minimum in a double array
- Parameters:
- data - The input double array
- low - The lower index
- high - The higher index
- Returns:
- The max and min data
getRange
public static float[] getRange(float data[],
int low,
int high)
- find the maximum and the minimum in a float array
- Parameters:
- data - The input float array
- low - The lower index
- high - The higher index
- Returns:
- The max and min data
getRange
public static long[] getRange(long data[],
int low,
int high)
- find the maximum and the minimum in a long array
- Parameters:
- data - The input long array
- low - The lower index
- high - The higher index
- Returns:
- The max and min data
getRange
public static int[] getRange(int data[],
int low,
int high)
- find the maximum and the minimum in a int array
- Parameters:
- data - The input int array
- low - The lower index
- high - The higher index
- Returns:
- The max and min data
getRange
public static byte[] getRange(byte data[],
int low,
int high)
- find the maximum and the minimum in a byte array
- Parameters:
- data - The input byte array
- low - The lower index
- high - The higher index
- Returns:
- The max and min data
getRange
public static short[] getRange(short data[],
int low,
int high)
- find the maximum and the minimum in a short array
- Parameters:
- data - The input byte array
- low - The lower index
- high - The higher index
- Returns:
- The max and min data
getRange
public static Object getRange(Object data)
- find the maximum and the minimum of an array
- Parameters:
- data - The data array
- Returns:
- The max and min data
getRange
public static Object getRange(Object data,
int low,
int high)
- find the maximum and the minimum of an array
// does not work correctly for irix machines
- Parameters:
- data - The data array
- low - The starting index
- high - The ending index
- Returns:
- The max and min data
All Packages Class Hierarchy This Package Previous Next Index