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

Variable Index

 o debug

Constructor Index

 o Tools()

Method Index

 o double2byte(double[])
convert a double to a byte array
 o getKey()
return a unique string key.
 o getRange(byte[])
find the maximum and the minimum in a byte array
 o getRange(byte[], int, int)
find the maximum and the minimum in a byte array
 o getRange(double[])
find the maximum and the minimum in a double array
 o getRange(double[], int, int)
find the maximum and the minimum in a double array
 o getRange(float[])
find the maximum and the minimum in a float array
 o getRange(float[], int, int)
find the maximum and the minimum in a float array
 o getRange(int[])
find the maximum and the minimum in a int array
 o getRange(int[], int, int)
find the maximum and the minimum in a int array
 o getRange(long[])
find the maximum and the minimum in a long array
 o getRange(long[], int, int)
find the maximum and the minimum in a long array
 o getRange(Object)
find the maximum and the minimum of an array
 o getRange(Object, int, int)
find the maximum and the minimum of an array // does not work correctly for irix machines
 o getRange(short[])
find the maximum and the minimum in a short array
 o getRange(short[], int, int)
find the maximum and the minimum in a short array
 o main(String[])
for testing purpose only
 o mean(Object)
calculate the mean value of an array
 o mean(Object, int, int)
calculate the mean value of an array
 o notFalse(boolean)
 o notFalse(boolean, String)
 o notNull(Object)
 o notNull(Object, String)
 o sort(Object)
Sort an array in ascending order with insert sort
 o sort(String[])
Sort an array of strings with insert sort
 o var(Object)
calculate the variance of an array
 o var(Object, int, int)
calculate the variance of an array

Variables

 o debug
 public static boolean debug

Constructors

 o Tools
 public Tools()

Methods

 o 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
 o notFalse
 public static void notFalse(boolean b) throws IllegalArgumentException
 o notNull
 public static void notNull(Object obj) throws IllegalArgumentException
 o notFalse
 public static void notFalse(boolean b,
                             String s) throws IllegalArgumentException
 o notNull
 public static void notNull(Object obj,
                            String s) throws IllegalArgumentException
 o sort
 public static void sort(Object array)
Sort an array in ascending order with insert sort

Parameters:
array - the data array to be sorted
 o sort
 public static void sort(String a[])
Sort an array of strings with insert sort

 o double2byte
 public static byte[] double2byte(double data[])
convert a double to a byte array

Parameters:
data - The input double array
Returns:
The byte array
 o mean
 public static double mean(Object data)
calculate the mean value of an array

Parameters:
data - The data array
Returns:
The mean value
 o 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
 o var
 public static double var(Object data)
calculate the variance of an array

Parameters:
data - The data array
Returns:
The variance
 o 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
 o main
 public static void main(String argv[])
for testing purpose only

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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