com.sibvisions.util
Class ArrayUtil<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by com.sibvisions.util.ArrayUtil<E>
Type Parameters:
E - placeholder for an object type
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess
Direct Known Subclasses:
AbstractStorage.AllFetchedList

public class ArrayUtil<E>
extends java.util.AbstractList<E>
implements java.util.RandomAccess, java.lang.Cloneable, java.io.Serializable

Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list. (This class is roughly equivalent to Vector, except that it is unsynchronized.)

This list implementation can also handle arrays of primitive data types.

It is very fast with add operations at the beginning and at the end of the list. A special mechanism reserves space at the beginning and at the end of the list. In usual usages (adding at the beginning or at the end) it is very fast. In average it is 2 times faster than ArrayList.

Special static functions helps with the directly handling of arrays.

int[] node = ArrayUtil.add(new int[] {1, 2, 3}, 4);

See Also:
Collection, List, ArrayList, Vector, Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ArrayUtil()
          Constructs an empty list with initial size MIN_SIZE.
ArrayUtil(java.util.Collection<? extends E> pCollection)
          Constructs a list containing the elements of the specified collection.
ArrayUtil(E... pSourceArray)
          Constructs a list with the given array.
ArrayUtil(E[] pSourceArray, int pSize)
          Constructs a list with the given array.
ArrayUtil(E[] pSourceArray, int pOffset, int pSize)
          Constructs a list with the given array.
ArrayUtil(int pInitialSize)
          Constructs an empty list.
 
Method Summary
static boolean[] add(boolean[] pSourceArray, boolean pElement)
          Inserts the specified element at the end in the given array.
static boolean[] add(boolean[] pSourceArray, int pIndex, boolean pElement)
          Inserts the specified element at the specified position in the given array.
static char[] add(char[] pSourceArray, char pElement)
          Inserts the specified element at the end in the given array.
static char[] add(char[] pSourceArray, int pIndex, char pElement)
          Inserts the specified element at the specified position in the given array.
static double[] add(double[] pSourceArray, double pElement)
          Inserts the specified element at the end in the given array.
static double[] add(double[] pSourceArray, int pIndex, double pElement)
          Inserts the specified element at the specified position in the given array.
 boolean add(E pElement)
          
static float[] add(float[] pSourceArray, float pElement)
          Inserts the specified element at the end in the given array.
static float[] add(float[] pSourceArray, int pIndex, float pElement)
          Inserts the specified element at the specified position in the given array.
static int[] add(int[] pSourceArray, int pElement)
          Inserts the specified element at the end in the given array.
static int[] add(int[] pSourceArray, int pIndex, int pElement)
          Inserts the specified element at the specified position in the given array.
 void add(int pIndex, E pElement)
          
static long[] add(long[] pSourceArray, int pIndex, long pElement)
          Inserts the specified element at the specified position in the given array.
static long[] add(long[] pSourceArray, long pElement)
          Inserts the specified element at the end in the given array.
static
<T> T[]
add(T[] pSourceArray, int pIndex, T pElement)
          Inserts the specified element at the specified position in the given array.
static
<T> T[]
add(T[] pSourceArray, T pElement)
          Inserts the specified element at the end in the given array.
static boolean[] addAll(boolean[] pSourceArray, boolean[] pArray)
          Inserts the specified array at the end in the given array.
static boolean[] addAll(boolean[] pSourceArray, int pIndex, boolean[] pArray)
          Inserts the specified array at the specified position in the given array.
static char[] addAll(char[] pSourceArray, char[] pArray)
          Inserts the specified array at the end in the given array.
static char[] addAll(char[] pSourceArray, int pIndex, char[] pArray)
          Inserts the specified array at the specified position in the given array.
 boolean addAll(java.util.Collection<? extends E> pCollection)
          
static double[] addAll(double[] pSourceArray, double[] pArray)
          Inserts the specified array at the end in the given array.
static double[] addAll(double[] pSourceArray, int pIndex, double[] pArray)
          Inserts the specified array at the specified position in the given array.
 boolean addAll(E[] pArray)
          Appends all of the elements in the specified Array to the end of this list.
static float[] addAll(float[] pSourceArray, float[] pArray)
          Inserts the specified array at the end in the given array.
static float[] addAll(float[] pSourceArray, int pIndex, float[] pArray)
          Inserts the specified array at the specified position in the given array.
static int[] addAll(int[] pSourceArray, int[] pArray)
          Inserts the specified array at the end in the given array.
static int[] addAll(int[] pSourceArray, int pIndex, int[] pArray)
          Inserts the specified array at the specified position in the given array.
 boolean addAll(int pIndex, java.util.Collection<? extends E> pCollection)
          
 boolean addAll(int pIndex, E[] pArray)
          Inserts all of the elements in the specified Array into this list, starting at the specified position.
 boolean addAll(int pIndex, E[] pArray, int pOffset, int pSize)
          Inserts size elements in the specified Array starting at offset into this list, starting at the specified position.
static long[] addAll(long[] pSourceArray, int pIndex, long[] pArray)
          Inserts the specified array at the specified position in the given array.
static long[] addAll(long[] pSourceArray, long[] pArray)
          Inserts the specified array at the end in the given array.
static
<T> T[]
addAll(T[] pSourceArray, int pIndex, T[] pArray)
          Inserts the specified array at the specified position in the given array.
static
<T> T[]
addAll(T[] pSourceArray, T[] pArray)
          Inserts the specified array at the end in the given array.
 void clear()
          
static boolean[] clear(boolean[] pSourceArray)
          Removes all Elements.
static char[] clear(char[] pSourceArray)
          Removes all Elements.
static double[] clear(double[] pSourceArray)
          Removes all Elements.
static float[] clear(float[] pSourceArray)
          Removes all Elements.
static int[] clear(int[] pSourceArray)
          Removes all Elements.
static long[] clear(long[] pSourceArray)
          Removes all Elements.
static
<T> T[]
clear(T[] pSourceArray)
          Removes all Elements.
 ArrayUtil<E> clone()
          Returns a shallow copy of this ArrayUtil instance.
static boolean contains(boolean[] pSourceArray, boolean pObject)
          Returns true if this list contains the specified element.
static boolean contains(char[] pSourceArray, char pObject)
          Returns true if this list contains the specified element.
static boolean contains(double[] pSourceArray, double pObject)
          Returns true if this list contains the specified element.
static boolean contains(float[] pSourceArray, float pObject)
          Returns true if this list contains the specified element.
static boolean contains(int[] pSourceArray, int pObject)
          Returns true if this list contains the specified element.
static boolean contains(long[] pSourceArray, long pObject)
          Returns true if this list contains the specified element.
 boolean contains(java.lang.Object pObject)
          
static
<T> boolean
contains(T[] pSourceArray, T pObject)
          Returns true if this list contains the specified element.
 boolean containsAll(E[] pElements)
          Checks if the current array contains all elements of a specific array.
static
<T> boolean
containsAll(T[] pSource, T[] pElements)
          Checks if a specific array contains all elements of another array.
 boolean containsOne(E[] pElements)
          Checks if the current array contains at least one element of a specific array.
static
<T> boolean
containsOne(T[] pSource, T[] pElements)
          Checks if a specific array contains at least one element of another array.
 boolean containsReference(java.lang.Object pObject)
          Returns true if this list contains the reference from the specified element.
static
<T> boolean
containsReference(T[] pSourceArray, T pObject)
          Returns true if this list contains the reference of the specified element.
 java.util.Enumeration<E> enumeration()
          Returns an enumeration of this collection.
 boolean equals(java.lang.Object pObject)
          
 E first()
          Gets the first element.
 E get(int pIndex)
          
 int hashCode()
          
static int indexOf(boolean[] pSourceArray, boolean pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static int indexOf(boolean[] pSourceArray, boolean pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int indexOf(char[] pSourceArray, char pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static int indexOf(char[] pSourceArray, char pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int indexOf(double[] pSourceArray, double pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static int indexOf(double[] pSourceArray, double pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int indexOf(float[] pSourceArray, float pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static int indexOf(float[] pSourceArray, float pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int indexOf(int[] pSourceArray, int pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static int indexOf(int[] pSourceArray, int pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int indexOf(long[] pSourceArray, long pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static int indexOf(long[] pSourceArray, long pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
 int indexOf(java.lang.Object pObject)
          
 int indexOf(java.lang.Object pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
indexOf(T[] pSourceArray, T pObject)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
static
<T> int
indexOf(T[] pSourceArray, T pObject, int pIndex)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
indexOf(T[] pSourceArray, T pObject, int pIndex, int pLength)
          Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
indexOfReference(java.util.List<T> pSourceList, T pObject)
          Returns the index in this list of the first occurence of the reference from the specified element, or -1 if the list does not contain this element.
static
<T> int
indexOfReference(java.util.List<T> pSourceList, T pObject, int pIndex)
          Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element.
 int indexOfReference(java.lang.Object pObject)
          Returns the index in this list of the first occurence of the reference from the specified element, or -1 if the list does not contain this element.
 int indexOfReference(java.lang.Object pObject, int pIndex)
          Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
indexOfReference(T[] pSourceArray, T pObject)
          Returns the index in this list of the first occurence of the reference from the specified element, or -1 if the list does not contain this element.
static
<T> int
indexOfReference(T[] pSourceArray, T pObject, int pIndex)
          Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> T[]
intersect(T[] pFirstArray, T[] pSecondArray)
          Creates an array which contains all elements that are available in both arrays.
 boolean isEmpty()
          
 E last()
          Gets the last element.
static int lastIndexOf(boolean[] pSourceArray, boolean pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static int lastIndexOf(boolean[] pSourceArray, boolean pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int lastIndexOf(char[] pSourceArray, char pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static int lastIndexOf(char[] pSourceArray, char pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int lastIndexOf(double[] pSourceArray, double pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static int lastIndexOf(double[] pSourceArray, double pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int lastIndexOf(float[] pSourceArray, float pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static int lastIndexOf(float[] pSourceArray, float pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int lastIndexOf(int[] pSourceArray, int pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static int lastIndexOf(int[] pSourceArray, int pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
lastIndexOf(java.util.List<T> pSourceList, T pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static
<T> int
lastIndexOf(java.util.List<T> pSourceList, T pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static int lastIndexOf(long[] pSourceArray, long pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static int lastIndexOf(long[] pSourceArray, long pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
 int lastIndexOf(java.lang.Object pObject)
          
 int lastIndexOf(java.lang.Object pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
lastIndexOf(T[] pSourceArray, T pObject)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
static
<T> int
lastIndexOf(T[] pSourceArray, T pObject, int pIndex)
          Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element.
 int lastIndexOfReference(java.lang.Object pObject)
          Returns the index in this list of the last occurence of the reference from the specified element, or -1 if the list does not contain this element.
 int lastIndexOfReference(java.lang.Object pObject, int pIndex)
          Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element.
static
<T> int
lastIndexOfReference(T[] pSourceArray, T pObject)
          Returns the index in this list of the last occurence of the reference from the specified element, or -1 if the list does not contain this element.
static
<T> int
lastIndexOfReference(T[] pSourceArray, T pObject, int pIndex)
          Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element.
static boolean[] merge(boolean[] pSourceArray, boolean[] pArray)
          Merges the values of two arrays.
static char[] merge(char[] pSourceArray, char[] pArray)
          Merges the values of two arrays.
static double[] merge(double[] pSourceArray, double[] pArray)
          Merges the values of two arrays.
 void merge(E[] pArray)
          Merges this collection with given array.
static float[] merge(float[] pSourceArray, float[] pArray)
          Merges the values of two arrays.
static int[] merge(int[] pSourceArray, int[] pArray)
          Merges the values of two arrays.
static long[] merge(long[] pSourceArray, long[] pArray)
          Merges the values of two arrays.
static
<T> T[]
merge(T[] pSourceArray, T[] pArray)
          Merges the values of two arrays.
static boolean[] remove(boolean[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
static char[] remove(char[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
static double[] remove(double[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
static float[] remove(float[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
 E remove(int pIndex)
          
static int[] remove(int[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
static long[] remove(long[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
 boolean remove(java.lang.Object pElement)
          
static
<T> T[]
remove(T[] pSourceArray, int pIndex)
          Removes one element at the given index of given array.
static
<T> T[]
remove(T[] pSourceArray, T pObject)
          Removes the given element of given array.
 boolean removeAll(E[] pArray)
          Removes from this collection all of its elements that are contained in the specified array.
static
<T> T[]
removeAll(T[] pSourceArray, T[] pArray)
          Removes the elements of a given array from the given source array.
 void removeLast()
          Removes the last element.
static boolean[] removeLast(boolean[] pSourceArray)
          Removes the last element of given array.
static char[] removeLast(char[] pSourceArray)
          Removes the last element of given array.
static double[] removeLast(double[] pSourceArray)
          Removes the last element of given array.
static float[] removeLast(float[] pSourceArray)
          Removes the last element of given array.
static int[] removeLast(int[] pSourceArray)
          Removes the last element of given array.
static long[] removeLast(long[] pSourceArray)
          Removes the last element of given array.
static
<T> T[]
removeLast(T[] pSourceArray)
          Removes the last element of given array.
static boolean[] removeRange(boolean[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
static char[] removeRange(char[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
static double[] removeRange(double[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
static float[] removeRange(float[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
static int[] removeRange(int[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
 void removeRange(int pFromIndex, int pToIndex)
          Removes the elements between pFromIndex inclusive and pToIndex exclusive of this ArrayUtil instance.
static long[] removeRange(long[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
static
<T> T[]
removeRange(T[] pSourceArray, int pFromIndex, int pToIndex)
          Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).
static
<T> T[]
removeReference(T[] pSourceArray, T pObject)
          Removes the given element of given array.
 E set(int pIndex, E pElement)
          
 void setSize(int pSize)
          Sets the size.
 int size()
          
 java.lang.Object[] toArray()
          
 E[] toArray(int pStart, int pLength)
          Creats a new array with a subset of the current elements.
<T> T[]
toArray(T[] pArray)
          
static boolean[] truncate(boolean[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
static char[] truncate(char[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
static double[] truncate(double[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
static float[] truncate(float[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
 void truncate(int pIndex)
          Removes all elements from the given index.
static int[] truncate(int[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
static long[] truncate(long[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
static
<T> T[]
truncate(T[] pSourceArray, int pIndex)
          Removes all elements from the given index of given array.
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, removeAll, retainAll
 

Constructor Detail

ArrayUtil

public ArrayUtil()
Constructs an empty list with initial size MIN_SIZE.


ArrayUtil

public ArrayUtil(int pInitialSize)
Constructs an empty list.

Parameters:
pInitialSize - the initial size.

ArrayUtil

public ArrayUtil(E... pSourceArray)
Constructs a list with the given array. The given array is used directly. If it should be cloned, it has to be done outside manually.

Parameters:
pSourceArray - the array for this list.
Throws:
java.lang.NullPointerException - if the specified pSourceArray is null.

ArrayUtil

public ArrayUtil(E[] pSourceArray,
                 int pSize)
Constructs a list with the given array. The given array is used directly. If it should be cloned, it has to be done outside manually. The list has the given size. If the size is < 0 the size is set to the array length. If the size is greater than the array length, an IndexOutOfBoundsException is thrown.

Parameters:
pSourceArray - the array for this list.
pSize - the size of this list.
Throws:
java.lang.NullPointerException - if the specified pSourceArray is null.
java.lang.IndexOutOfBoundsException - if the specified pSize is greater than the array length.

ArrayUtil

public ArrayUtil(E[] pSourceArray,
                 int pOffset,
                 int pSize)
Constructs a list with the given array. The given array is used directly. If it should be cloned, it has to be done outside manually. The list starts at the given offset. The list has the given size. If the size is < 0 the size is set to the array length. If offset + size is greater than the array length, an IndexOutOfBoundsException is thrown.

Parameters:
pSourceArray - the array for this list.
pOffset - the offset at which the list starts.
pSize - the size of this list.
Throws:
java.lang.IndexOutOfBoundsException - if the specified pOffset + pSize is greater than the array length.

ArrayUtil

public ArrayUtil(java.util.Collection<? extends E> pCollection)
Constructs a list containing the elements of the specified collection.

Parameters:
pCollection - the collection whose elements are to be placed into this list.
Throws:
java.lang.NullPointerException - if the specified collection is null.
Method Detail

add

public boolean add(E pElement)

Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.List<E>
Overrides:
add in class java.util.AbstractList<E>

add

public void add(int pIndex,
                E pElement)

Specified by:
add in interface java.util.List<E>
Overrides:
add in class java.util.AbstractList<E>

addAll

public boolean addAll(java.util.Collection<? extends E> pCollection)

Specified by:
addAll in interface java.util.Collection<E>
Specified by:
addAll in interface java.util.List<E>
Overrides:
addAll in class java.util.AbstractCollection<E>

addAll

public boolean addAll(int pIndex,
                      java.util.Collection<? extends E> pCollection)

Specified by:
addAll in interface java.util.List<E>
Overrides:
addAll in class java.util.AbstractList<E>

addAll

public boolean addAll(E[] pArray)
Appends all of the elements in the specified Array to the end of this list.

Parameters:
pArray - the elements to be inserted into this list.
Returns:
true if this list changed as a result of the call.

addAll

public boolean addAll(int pIndex,
                      E[] pArray)
Inserts all of the elements in the specified Array into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices).

Parameters:
pIndex - index at which to insert first element from the specified collection.
pArray - elements to be inserted into this list.
Returns:
true if this list changed as a result of the call.
Throws:
java.lang.IndexOutOfBoundsException - if index out of range (index < 0 || index > size()).

addAll

public boolean addAll(int pIndex,
                      E[] pArray,
                      int pOffset,
                      int pSize)
Inserts size elements in the specified Array starting at offset into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices).

Parameters:
pIndex - index at which to insert first element from the specified collection.
pArray - elements to be inserted into this list.
pOffset - the offset from that should be copied.
pSize - the size that should be copied.
Returns:
true if this list changed as a result of the call.
Throws:
java.lang.IndexOutOfBoundsException - if index out of range (index < 0 || index > size()).

merge

public void merge(E[] pArray)
Merges this collection with given array. The merged collection will only contain unique values.

Parameters:
pArray - the array to merge

setSize

public void setSize(int pSize)
Sets the size. If the new size is greater than the current size, new null items are added to the end. If the new size is less than the current size, all components at index pSize and greater are discarded.

Parameters:
pSize - the new size of this vector.

clear

public void clear()

Specified by:
clear in interface java.util.Collection<E>
Specified by:
clear in interface java.util.List<E>
Overrides:
clear in class java.util.AbstractList<E>

contains

public boolean contains(java.lang.Object pObject)

Specified by:
contains in interface java.util.Collection<E>
Specified by:
contains in interface java.util.List<E>
Overrides:
contains in class java.util.AbstractCollection<E>

get

public E get(int pIndex)

Specified by:
get in interface java.util.List<E>
Specified by:
get in class java.util.AbstractList<E>

indexOf

public int indexOf(java.lang.Object pObject)

Specified by:
indexOf in interface java.util.List<E>
Overrides:
indexOf in class java.util.AbstractList<E>

indexOf

public int indexOf(java.lang.Object pObject,
                   int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

containsReference

public boolean containsReference(java.lang.Object pObject)
Returns true if this list contains the reference from the specified element.

Parameters:
pObject - element to search for.
Returns:
true if this list contains the reference from the specified element.

indexOfReference

public int indexOfReference(java.lang.Object pObject)
Returns the index in this list of the first occurence of the reference from the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Parameters:
pObject - element to search for.
Returns:
the index in this List of the first occurence of the reference from specified element, or -1 if the List does not contain this element.

indexOfReference

public int indexOfReference(java.lang.Object pObject,
                            int pIndex)
Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Parameters:
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the reference from specified element started at pIndex, or -1 if the List does not contain this element.

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Collection<E>
Specified by:
isEmpty in interface java.util.List<E>
Overrides:
isEmpty in class java.util.AbstractCollection<E>

lastIndexOf

public int lastIndexOf(java.lang.Object pObject)

Specified by:
lastIndexOf in interface java.util.List<E>
Overrides:
lastIndexOf in class java.util.AbstractList<E>

lastIndexOf

public int lastIndexOf(java.lang.Object pObject,
                       int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOfReference

public int lastIndexOfReference(java.lang.Object pObject)
Returns the index in this list of the last occurence of the reference from the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Parameters:
pObject - element to search for.
Returns:
the index in this List of the last occurence of the reference from specified element, or -1 if the List does not contain this element.

lastIndexOfReference

public int lastIndexOfReference(java.lang.Object pObject,
                                int pIndex)
Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Parameters:
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the reference from specified element started at pIndex, or -1 if the List does not contain this element.

removeRange

public void removeRange(int pFromIndex,
                        int pToIndex)
Removes the elements between pFromIndex inclusive and pToIndex exclusive of this ArrayUtil instance. If there is too much space left in the array the empty space will be reduced.

Overrides:
removeRange in class java.util.AbstractList<E>
Parameters:
pFromIndex - index of first element to be removed.
pToIndex - index after last element to be removed.

remove

public boolean remove(java.lang.Object pElement)

Specified by:
remove in interface java.util.Collection<E>
Specified by:
remove in interface java.util.List<E>
Overrides:
remove in class java.util.AbstractCollection<E>

remove

public E remove(int pIndex)

Specified by:
remove in interface java.util.List<E>
Overrides:
remove in class java.util.AbstractList<E>

removeLast

public void removeLast()
Removes the last element.


removeAll

public boolean removeAll(E[] pArray)
Removes from this collection all of its elements that are contained in the specified array.

This implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified array. If it's so contained, it's removed from this collection with the iterator's remove method.

Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements in common with the specified collection.

Parameters:
pArray - elements to be removed from this collection.
Returns:
true if this collection changed as a result of the call.
Throws:
java.lang.UnsupportedOperationException - if the removeAll method is not supported by this collection.
See Also:
remove(Object), contains(Object)

truncate

public void truncate(int pIndex)
Removes all elements from the given index.

Parameters:
pIndex - the index starting to remove all elements.

set

public E set(int pIndex,
             E pElement)

Specified by:
set in interface java.util.List<E>
Overrides:
set in class java.util.AbstractList<E>

size

public int size()

Specified by:
size in interface java.util.Collection<E>
Specified by:
size in interface java.util.List<E>
Specified by:
size in class java.util.AbstractCollection<E>

enumeration

public java.util.Enumeration<E> enumeration()
Returns an enumeration of this collection. This provides interoperability with legacy APIs that require an enumeration as input.

Returns:
an enumeration over this collection.
See Also:
Enumeration

clone

public ArrayUtil<E> clone()
Returns a shallow copy of this ArrayUtil instance. (The elements themselves are not copied.)

Overrides:
clone in class java.lang.Object
Returns:
a clone of this ArrayUtil instance.

toArray

public java.lang.Object[] toArray()

Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Overrides:
toArray in class java.util.AbstractCollection<E>

toArray

public <T> T[] toArray(T[] pArray)

Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Overrides:
toArray in class java.util.AbstractCollection<E>

equals

public boolean equals(java.lang.Object pObject)

Specified by:
equals in interface java.util.Collection<E>
Specified by:
equals in interface java.util.List<E>
Overrides:
equals in class java.util.AbstractList<E>

hashCode

public int hashCode()

Specified by:
hashCode in interface java.util.Collection<E>
Specified by:
hashCode in interface java.util.List<E>
Overrides:
hashCode in class java.util.AbstractList<E>

add

public static <T> T[] add(T[] pSourceArray,
                          int pIndex,
                          T pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static <T> T[] add(T[] pSourceArray,
                          T pElement)
Inserts the specified element at the end in the given array.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static <T> T[] addAll(T[] pSourceArray,
                             int pIndex,
                             T[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static <T> T[] addAll(T[] pSourceArray,
                             T[] pArray)
Inserts the specified array at the end in the given array.

Type Parameters:
T - Component Type of Array
Parameters:
pSourceArray - array in which to add
pArray - elements to be inserted
Returns:
returns a new array if needed

merge

public static boolean[] merge(boolean[] pSourceArray,
                              boolean[] pArray)
Merges the values of two arrays. The result will contain unique values.

Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

merge

public static float[] merge(float[] pSourceArray,
                            float[] pArray)
Merges the values of two arrays. The result will contain unique values.

Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

merge

public static double[] merge(double[] pSourceArray,
                             double[] pArray)
Merges the values of two arrays. The result will contain unique values.

Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

merge

public static int[] merge(int[] pSourceArray,
                          int[] pArray)
Merges the values of two arrays. The result will contain unique values.

Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

merge

public static long[] merge(long[] pSourceArray,
                           long[] pArray)
Merges the values of two arrays. The result will contain unique values.

Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

merge

public static char[] merge(char[] pSourceArray,
                           char[] pArray)
Merges the values of two arrays. The result will contain unique values.

Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

merge

public static <T> T[] merge(T[] pSourceArray,
                            T[] pArray)
Merges the values of two arrays. The result will contain unique values.

Type Parameters:
T - Component Type of Array
Parameters:
pSourceArray - the source array
pArray - the array to merge
Returns:
the result with unique values

removeRange

public static <T> T[] removeRange(T[] pSourceArray,
                                  int pFromIndex,
                                  int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static <T> T[] remove(T[] pSourceArray,
                             int pIndex)
Removes one element at the given index of given array.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static <T> T[] removeLast(T[] pSourceArray)
Removes the last element of given array.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

remove

public static <T> T[] remove(T[] pSourceArray,
                             T pObject)
Removes the given element of given array.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to delete.
pObject - the given element.
Returns:
returns a new array if needed.

removeReference

public static <T> T[] removeReference(T[] pSourceArray,
                                      T pObject)
Removes the given element of given array.

Type Parameters:
T - component Type of Array.
Parameters:
pSourceArray - array in which to delete.
pObject - the given element.
Returns:
returns a new array if needed.

removeAll

public static <T> T[] removeAll(T[] pSourceArray,
                                T[] pArray)
Removes the elements of a given array from the given source array.

Type Parameters:
T - component type of array.
Parameters:
pSourceArray - the original elements.
pArray - elements to be removed.
Returns:
the source array without removed elements.

intersect

public static <T> T[] intersect(T[] pFirstArray,
                                T[] pSecondArray)
Creates an array which contains all elements that are available in both arrays.

Type Parameters:
T - component type of array.
Parameters:
pFirstArray - the first set of elements.
pSecondArray - the second set of elements.
Returns:
the new array with intersecting elements

truncate

public static <T> T[] truncate(T[] pSourceArray,
                               int pIndex)
Removes all elements from the given index of given array.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static <T> T[] clear(T[] pSourceArray)
Removes all Elements.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static <T> boolean contains(T[] pSourceArray,
                                   T pObject)
Returns true if this list contains the specified element.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static <T> int indexOf(T[] pSourceArray,
                              T pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static <T> int indexOf(T[] pSourceArray,
                              T pObject,
                              int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

indexOf

public static <T> int indexOf(T[] pSourceArray,
                              T pObject,
                              int pIndex,
                              int pLength)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
pLength - length of the source array
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

containsReference

public static <T> boolean containsReference(T[] pSourceArray,
                                            T pObject)
Returns true if this list contains the reference of the specified element.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the reference of the specified element.

indexOfReference

public static <T> int indexOfReference(T[] pSourceArray,
                                       T pObject)
Returns the index in this list of the first occurence of the reference from the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the reference from specified element, or -1 if the List does not contain this element.

indexOfReference

public static <T> int indexOfReference(T[] pSourceArray,
                                       T pObject,
                                       int pIndex)
Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the reference from specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static <T> int lastIndexOf(T[] pSourceArray,
                                  T pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static <T> int lastIndexOf(T[] pSourceArray,
                                  T pObject,
                                  int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

indexOfReference

public static <T> int indexOfReference(java.util.List<T> pSourceList,
                                       T pObject)
Returns the index in this list of the first occurence of the reference from the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Type Parameters:
T - Component Type of the List.
Parameters:
pSourceList - list in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the reference from specified element, or -1 if the List does not contain this element.

indexOfReference

public static <T> int indexOfReference(java.util.List<T> pSourceList,
                                       T pObject,
                                       int pIndex)
Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Type Parameters:
T - Component Type of the List.
Parameters:
pSourceList - list in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the reference from specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static <T> int lastIndexOf(java.util.List<T> pSourceList,
                                  T pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of the List.
Parameters:
pSourceList - list in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static <T> int lastIndexOf(java.util.List<T> pSourceList,
                                  T pObject,
                                  int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Type Parameters:
T - Component Type of the List.
Parameters:
pSourceList - list in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOfReference

public static <T> int lastIndexOfReference(T[] pSourceArray,
                                           T pObject)
Returns the index in this list of the last occurence of the reference from the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the reference from specified element, or -1 if the List does not contain this element.

lastIndexOfReference

public static <T> int lastIndexOfReference(T[] pSourceArray,
                                           T pObject,
                                           int pIndex)
Returns the index in this list of the first occurence of the reference from the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that o==get(i), or -1 if there is no such index.

Type Parameters:
T - Component Type of Array.
Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the reference from specified element started at pIndex, or -1 if the List does not contain this element.

add

public static boolean[] add(boolean[] pSourceArray,
                            int pIndex,
                            boolean pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static boolean[] add(boolean[] pSourceArray,
                            boolean pElement)
Inserts the specified element at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static boolean[] addAll(boolean[] pSourceArray,
                               int pIndex,
                               boolean[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static boolean[] addAll(boolean[] pSourceArray,
                               boolean[] pArray)
Inserts the specified array at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pArray - elements to be inserted.
Returns:
returns a new array if needed.

removeRange

public static boolean[] removeRange(boolean[] pSourceArray,
                                    int pFromIndex,
                                    int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static boolean[] remove(boolean[] pSourceArray,
                               int pIndex)
Removes one element at the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static boolean[] removeLast(boolean[] pSourceArray)
Removes the last element of given array.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

truncate

public static boolean[] truncate(boolean[] pSourceArray,
                                 int pIndex)
Removes all elements from the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static boolean[] clear(boolean[] pSourceArray)
Removes all Elements.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static boolean contains(boolean[] pSourceArray,
                               boolean pObject)
Returns true if this list contains the specified element.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static int indexOf(boolean[] pSourceArray,
                          boolean pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static int indexOf(boolean[] pSourceArray,
                          boolean pObject,
                          int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(boolean[] pSourceArray,
                              boolean pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(boolean[] pSourceArray,
                              boolean pObject,
                              int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

add

public static char[] add(char[] pSourceArray,
                         int pIndex,
                         char pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static char[] add(char[] pSourceArray,
                         char pElement)
Inserts the specified element at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static char[] addAll(char[] pSourceArray,
                            int pIndex,
                            char[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static char[] addAll(char[] pSourceArray,
                            char[] pArray)
Inserts the specified array at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pArray - elements to be inserted.
Returns:
returns a new array if needed.

removeRange

public static char[] removeRange(char[] pSourceArray,
                                 int pFromIndex,
                                 int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static char[] remove(char[] pSourceArray,
                            int pIndex)
Removes one element at the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static char[] removeLast(char[] pSourceArray)
Removes the last element of given array.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

truncate

public static char[] truncate(char[] pSourceArray,
                              int pIndex)
Removes all elements from the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static char[] clear(char[] pSourceArray)
Removes all Elements.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static boolean contains(char[] pSourceArray,
                               char pObject)
Returns true if this list contains the specified element.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static int indexOf(char[] pSourceArray,
                          char pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static int indexOf(char[] pSourceArray,
                          char pObject,
                          int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(char[] pSourceArray,
                              char pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(char[] pSourceArray,
                              char pObject,
                              int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

add

public static int[] add(int[] pSourceArray,
                        int pIndex,
                        int pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static int[] add(int[] pSourceArray,
                        int pElement)
Inserts the specified element at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static int[] addAll(int[] pSourceArray,
                           int pIndex,
                           int[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static int[] addAll(int[] pSourceArray,
                           int[] pArray)
Inserts the specified array at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pArray - elements to be inserted.
Returns:
returns a new array if needed.

removeRange

public static int[] removeRange(int[] pSourceArray,
                                int pFromIndex,
                                int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static int[] remove(int[] pSourceArray,
                           int pIndex)
Removes one element at the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static int[] removeLast(int[] pSourceArray)
Removes the last element of given array.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

truncate

public static int[] truncate(int[] pSourceArray,
                             int pIndex)
Removes all elements from the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static int[] clear(int[] pSourceArray)
Removes all Elements.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static boolean contains(int[] pSourceArray,
                               int pObject)
Returns true if this list contains the specified element.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static int indexOf(int[] pSourceArray,
                          int pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static int indexOf(int[] pSourceArray,
                          int pObject,
                          int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(int[] pSourceArray,
                              int pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(int[] pSourceArray,
                              int pObject,
                              int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

add

public static long[] add(long[] pSourceArray,
                         int pIndex,
                         long pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static long[] add(long[] pSourceArray,
                         long pElement)
Inserts the specified element at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static long[] addAll(long[] pSourceArray,
                            int pIndex,
                            long[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static long[] addAll(long[] pSourceArray,
                            long[] pArray)
Inserts the specified array at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pArray - elements to be inserted.
Returns:
returns a new array if needed.

removeRange

public static long[] removeRange(long[] pSourceArray,
                                 int pFromIndex,
                                 int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static long[] remove(long[] pSourceArray,
                            int pIndex)
Removes one element at the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static long[] removeLast(long[] pSourceArray)
Removes the last element of given array.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

truncate

public static long[] truncate(long[] pSourceArray,
                              int pIndex)
Removes all elements from the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static long[] clear(long[] pSourceArray)
Removes all Elements.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static boolean contains(long[] pSourceArray,
                               long pObject)
Returns true if this list contains the specified element.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static int indexOf(long[] pSourceArray,
                          long pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static int indexOf(long[] pSourceArray,
                          long pObject,
                          int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(long[] pSourceArray,
                              long pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(long[] pSourceArray,
                              long pObject,
                              int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

add

public static float[] add(float[] pSourceArray,
                          int pIndex,
                          float pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static float[] add(float[] pSourceArray,
                          float pElement)
Inserts the specified element at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static float[] addAll(float[] pSourceArray,
                             int pIndex,
                             float[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static float[] addAll(float[] pSourceArray,
                             float[] pArray)
Inserts the specified array at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pArray - elements to be inserted.
Returns:
returns a new array if needed.

removeRange

public static float[] removeRange(float[] pSourceArray,
                                  int pFromIndex,
                                  int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static float[] remove(float[] pSourceArray,
                             int pIndex)
Removes one element at the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static float[] removeLast(float[] pSourceArray)
Removes the last element of given array.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

truncate

public static float[] truncate(float[] pSourceArray,
                               int pIndex)
Removes all elements from the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static float[] clear(float[] pSourceArray)
Removes all Elements.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static boolean contains(float[] pSourceArray,
                               float pObject)
Returns true if this list contains the specified element.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static int indexOf(float[] pSourceArray,
                          float pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static int indexOf(float[] pSourceArray,
                          float pObject,
                          int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(float[] pSourceArray,
                              float pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(float[] pSourceArray,
                              float pObject,
                              int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

add

public static double[] add(double[] pSourceArray,
                           int pIndex,
                           double pElement)
Inserts the specified element at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pElement - element to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

add

public static double[] add(double[] pSourceArray,
                           double pElement)
Inserts the specified element at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pElement - element to be inserted.
Returns:
returns a new array if needed.

addAll

public static double[] addAll(double[] pSourceArray,
                              int pIndex,
                              double[] pArray)
Inserts the specified array at the specified position in the given array. Shifts the element currently at that position (if any) and any subsequent elements to the right. If the index is negative the element is added at the end.

Parameters:
pSourceArray - array in which to add.
pIndex - index at which the specified element is to be inserted.
pArray - elements to be inserted.
Returns:
returns a new array if needed.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index > size()).

addAll

public static double[] addAll(double[] pSourceArray,
                              double[] pArray)
Inserts the specified array at the end in the given array.

Parameters:
pSourceArray - array in which to add.
pArray - elements to be inserted.
Returns:
returns a new array if needed.

removeRange

public static double[] removeRange(double[] pSourceArray,
                                   int pFromIndex,
                                   int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array).

Parameters:
pSourceArray - array in which to delete.
pFromIndex - the first index.
pToIndex - the last index (not included).
Returns:
returns a new array if needed.

remove

public static double[] remove(double[] pSourceArray,
                              int pIndex)
Removes one element at the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index where elements should be deleted.
Returns:
returns a new array if needed.

removeLast

public static double[] removeLast(double[] pSourceArray)
Removes the last element of given array.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

truncate

public static double[] truncate(double[] pSourceArray,
                                int pIndex)
Removes all elements from the given index of given array.

Parameters:
pSourceArray - array in which to delete.
pIndex - the index starting to remove all elements.
Returns:
returns a new array if needed.

clear

public static double[] clear(double[] pSourceArray)
Removes all Elements.

Parameters:
pSourceArray - array in which to delete.
Returns:
returns a new array if needed.

contains

public static boolean contains(double[] pSourceArray,
                               double pObject)
Returns true if this list contains the specified element.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
true if this list contains the specified element.

indexOf

public static int indexOf(double[] pSourceArray,
                          double pObject)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.

indexOf

public static int indexOf(double[] pSourceArray,
                          double pObject,
                          int pIndex)
Returns the index in this list of the first occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the first occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(double[] pSourceArray,
                              double pObject)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
Returns:
the index in this List of the last occurence of the specified element, or -1 if the List does not contain this element.

lastIndexOf

public static int lastIndexOf(double[] pSourceArray,
                              double pObject,
                              int pIndex)
Returns the index in this list of the last occurence of the specified element started at pIndex, or -1 if the list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
pSourceArray - array in which to search.
pObject - element to search for.
pIndex - index at which the search starts.
Returns:
the index in this List of the last occurence of the specified element started at pIndex, or -1 if the List does not contain this element.

containsAll

public static <T> boolean containsAll(T[] pSource,
                                      T[] pElements)
Checks if a specific array contains all elements of another array. It doesn't check if the array sizes are equal or the elements are duplicted.

Type Parameters:
T - Component Type of Array
Parameters:
pSource - the source array
pElements - the elements to find
Returns:
true if the source array contains all elements, false otherwise
Throws:
java.lang.NullPointerException - if the source array is null

containsOne

public static <T> boolean containsOne(T[] pSource,
                                      T[] pElements)
Checks if a specific array contains at least one element of another array.

Type Parameters:
T - Component Type of Array
Parameters:
pSource - the source array
pElements - the elements to find
Returns:
true if the source array contains at least one element, false otherwise
Throws:
java.lang.NullPointerException - if the source array is null

containsAll

public boolean containsAll(E[] pElements)
Checks if the current array contains all elements of a specific array. It doesn't check if the array sizes are equal or the elements are duplicted.

Parameters:
pElements - the elements to find
Returns:
true if the current array contains all elements, false otherwise

containsOne

public boolean containsOne(E[] pElements)
Checks if the current array contains at least one element of a specific array.

Parameters:
pElements - the elements to find
Returns:
true if the current array contains at least one element, false otherwise

toArray

public E[] toArray(int pStart,
                   int pLength)
Creats a new array with a subset of the current elements.

Parameters:
pStart - the start index
pLength - the length
Returns:
the elements as array

first

public E first()
Gets the first element.

Returns:
the first element

last

public E last()
Gets the last element.

Returns:
the last element


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.