|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--shared.MLJArray
This class includes methods useful in the manipulation of arrays. All of the functions are static to make the use of this class easier for any type of array.
| Method Summary | |
static boolean[] |
copy(boolean[] source)
Copies the given boolean array and returns the copy. |
static double[] |
copy(double[] source)
Copies the given double array and returns the copy. |
static int[] |
copy(int[] source)
Copies the given integer array and returns the copy. |
static int |
find(double key,
int startPosition,
double[] array)
Searches an array of double values for a specified value. |
static void |
init_values(double initialValue,
double[] array)
Initializes an array to a specified double value. |
static void |
init_values(int initialValue,
int[] array)
Initializes an array to a specified integer value. |
static double |
max(IntRef index,
double[] array)
Finds the maximum value in an array of double values. |
static int |
num_element(boolean key,
boolean[] array)
Counts the number of values in a boolean array match a specified value. |
static int |
sort_compare(Sortable a,
Sortable b)
Deprecated. |
static void |
sort(int[] theArray)
Sorts the specified array of integers. |
static void |
sort(java.lang.Object[] theArray,
java.lang.reflect.Method sortMethod)
Deprecated. |
static void |
sort(Sortable[] theArray)
Deprecated. |
static double |
sum(double[] array)
Returns the sum of an array of double values. |
static java.lang.Object[] |
truncate(int newSize,
java.lang.Object[] array)
This function truncates an array of Objects. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Method Detail |
public static double sum(double[] array)
array - The array of double values to be added.
public static void init_values(double initialValue,
double[] array)
initialValue - The value to be initialized.array - The array to be initialized.
public static void init_values(int initialValue,
int[] array)
initialValue - The value to be initialized.array - The array to be initialized.
public static int sort_compare(Sortable a,
Sortable b)
a - The first item to be compared.b - The second item to be compared.public static void sort(Sortable[] theArray)
theArray - The array to be sorted. The objects in the array must
implment the sortable interface.
public static void sort(java.lang.Object[] theArray,
java.lang.reflect.Method sortMethod)
theArray - The array to be sorted.sortMethod - The Method used for sorting.
public static double max(IntRef index,
double[] array)
index - An IntRef holding the place of the maximum value in the
array.array - The array to be searched.
public static int find(double key,
int startPosition,
double[] array)
key - The value to be searched for.startPosition - The array index to start searching from.array - The array to be searched.public static void sort(int[] theArray)
theArray - The array to be sorted. The array is changed by the use
of this method.
public static int num_element(boolean key,
boolean[] array)
key - The value to be searched for.array - The array to be searched.public static int[] copy(int[] source)
source - The array to be copied.public static double[] copy(double[] source)
source - The array to be copied.public static boolean[] copy(boolean[] source)
source - The array to be copied.
public static java.lang.Object[] truncate(int newSize,
java.lang.Object[] array)
newSize - The new size of the array.array - The array to be truncated.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||