|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.ArrayUtil
public class ArrayUtil
Constructor Summary | |
---|---|
ArrayUtil()
|
Method Summary | |
---|---|
static double |
average(double[] values)
Get the average of an array of values. |
static byte[] |
clone(byte[] orig)
Clone a byte array, maintaining awareness of null arrays |
static java.lang.Object[] |
combine(java.lang.Object[] a1,
java.lang.Object[] a2)
Combine two arrays into a single, larger array. |
static boolean |
equals(java.lang.Object[] a1,
java.lang.Object[] a2)
Array equality |
static boolean |
exists(java.lang.Object[] array,
java.lang.Object element)
Return a boolean whether or not the element exists in the array |
static int |
find(java.lang.Object[] array,
java.lang.Object element)
Find the index of the first appearance of an object in the array |
static int |
findMinDiff(double[] values)
Find the 2 values with the smallest difference between them. |
static boolean |
isUniq(java.lang.String[] values)
Check to see if a _sorted_ array of values contains all unique values. |
static int |
max(double[] values)
Find the maximum value in an array of double values. |
static int |
max(int[] values)
Find the maximum value in an array of int values. |
static java.lang.Object[] |
merge(java.lang.Object[][] arrays,
java.lang.Object[] arrType)
|
static java.lang.Object[] |
merge(java.lang.Object[] one,
java.lang.Object[] two,
java.lang.Object[] arrType)
|
static int |
min(double[] values)
Find the minimum value in an array of double values. |
static int[] |
stringToInt(java.lang.String[] array)
Convert a string array to an array of int. |
static java.lang.Integer[] |
stringToInteger(java.lang.String[] array)
Convert a string array to an array of Integer. |
static java.lang.String |
toString(java.lang.Object[] array)
|
static double[] |
uniq(double[] values)
Return an array of values where every value is unique. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayUtil()
Method Detail |
---|
public static java.lang.String toString(java.lang.Object[] array)
public static java.lang.Object[] merge(java.lang.Object[][] arrays, java.lang.Object[] arrType)
public static java.lang.Object[] merge(java.lang.Object[] one, java.lang.Object[] two, java.lang.Object[] arrType)
public static int max(double[] values)
values
- Values to search for to find the max of
public static int max(int[] values)
values
- Values to search for to find the max of
public static int min(double[] values)
values
- Values to search for to find the min of
public static double average(double[] values)
public static double[] uniq(double[] values)
values
- Values to get the unique of. Note that this
array _must_ be sorted, prior to invoking this method
public static boolean isUniq(java.lang.String[] values)
public static boolean equals(java.lang.Object[] a1, java.lang.Object[] a2)
public static int findMinDiff(double[] values)
values
- An array of _sorted_, _unique_ values
public static boolean exists(java.lang.Object[] array, java.lang.Object element)
array
- An array of objectselement
- The element to look for in the array
public static int find(java.lang.Object[] array, java.lang.Object element)
public static java.lang.Integer[] stringToInteger(java.lang.String[] array)
array
is null, null will be returned.
array
- string array
java.lang.NumberFormatException
- if an element in the String array
is not parseable into an Integerpublic static int[] stringToInt(java.lang.String[] array)
array
is null, null will be returned.
array
- string array
java.lang.NumberFormatException
- if an element in the String array
is not parseable into an intpublic static java.lang.Object[] combine(java.lang.Object[] a1, java.lang.Object[] a2)
a1
- The first array. If this is null, a copy of the second array
is returned (unless it's null too, then null is returned).a2
- The second array. If this is null, a copy of the first array
is returned (unless it's null too, then null is returned).
public static byte[] clone(byte[] orig)
orig
- Byte array to clone (can be null)
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |