|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.util.ArrayHelper
public final class ArrayHelper
A class containing convenience methods for working with arrays.
Constructor Summary | |
---|---|
ArrayHelper()
|
Method Summary | ||
---|---|---|
static boolean |
contains(java.lang.Object[] array,
java.lang.Object key)
|
|
static int |
firstGreaterThan(double[] array,
double key)
Works on non sorted arrays |
|
static int |
firstGreaterThan(double[] array,
double key,
int rangeStart,
int rangeEnd)
Works on non sorted arrays |
|
static int |
firstGreaterThanInSorted(double[] array,
double key)
Works fast on sorted arrays |
|
static int |
firstGreaterThanInSorted(double[] array,
double key,
int startIndex,
int endIndex)
Works fast on sorted arrays |
|
static int |
firstIndexOf(java.lang.Object array,
java.lang.Object key)
|
|
static void |
flip(java.lang.Object array)
|
|
static java.lang.Object[] |
getArrayFromEnumeration(java.util.Enumeration e)
|
|
static java.lang.Object[] |
getArrayFromIterator(java.util.Iterator i)
|
|
static
|
subArray(java.lang.Class<T> clazz,
java.util.List<T> list,
int offset,
int length)
Get a sub array of a list. |
|
static double[] |
toDoubleArray(java.lang.Object array)
|
|
static int[] |
toIntArray(java.lang.Number[] input)
|
|
static java.lang.Integer[] |
toIntegerArray(int[] input)
|
|
static java.lang.Object |
trim(java.lang.Object[] array)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayHelper()
Method Detail |
---|
public static int firstGreaterThan(double[] array, double key)
public static int firstGreaterThan(double[] array, double key, int rangeStart, int rangeEnd)
public static int firstGreaterThanInSorted(double[] array, double key)
public static int firstGreaterThanInSorted(double[] array, double key, int startIndex, int endIndex)
public static int firstIndexOf(java.lang.Object array, java.lang.Object key)
public static boolean contains(java.lang.Object[] array, java.lang.Object key)
public static java.lang.Object[] getArrayFromEnumeration(java.util.Enumeration e)
public static java.lang.Object[] getArrayFromIterator(java.util.Iterator i)
public static void flip(java.lang.Object array)
public static double[] toDoubleArray(java.lang.Object array)
public static java.lang.Object trim(java.lang.Object[] array)
public static java.lang.Integer[] toIntegerArray(int[] input)
public static int[] toIntArray(java.lang.Number[] input)
public static <T> T[] subArray(java.lang.Class<T> clazz, java.util.List<T> list, int offset, int length)
T
- Type of list's elements.clazz
- The type of list's elements.list
- The list.offset
- Offset in the list that will be the first element of the
resulting array.length
- Number of elements in the list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |