|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
com.sibvisions.util.ArrayUtil<E>
E
- placeholder for an object typepublic class ArrayUtil<E>
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);
Collection
,
List
,
ArrayList
,
Vector
,
Serialized FormField 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
|
add(T[] pSourceArray,
int pIndex,
T pElement)
Inserts the specified element at the specified position in the given array. |
|
static
|
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
|
addAll(T[] pSourceArray,
int pIndex,
T[] pArray)
Inserts the specified array at the specified position in the given array. |
|
static
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
remove(T[] pSourceArray,
int pIndex)
Removes one element at the given index of given array. |
|
static
|
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
|
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
|
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
|
removeRange(T[] pSourceArray,
int pFromIndex,
int pToIndex)
Removes all elements between fromIndex (inclusive) and toIndex (exclusive of given array). |
|
static
|
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. |
|
|
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
|
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 |
---|
public ArrayUtil()
MIN_SIZE
.
public ArrayUtil(int pInitialSize)
pInitialSize
- the initial size.public ArrayUtil(E... pSourceArray)
pSourceArray
- the array for this list.
java.lang.NullPointerException
- if the specified pSourceArray is null.public ArrayUtil(E[] pSourceArray, int pSize)
pSourceArray
- the array for this list.pSize
- the size of this list.
java.lang.NullPointerException
- if the specified pSourceArray is null.
java.lang.IndexOutOfBoundsException
- if the specified pSize is greater than the array length.public ArrayUtil(E[] pSourceArray, int pOffset, int pSize)
pSourceArray
- the array for this list.pOffset
- the offset at which the list starts.pSize
- the size of this list.
java.lang.IndexOutOfBoundsException
- if the specified pOffset + pSize is greater than the array length.public ArrayUtil(java.util.Collection<? extends E> pCollection)
pCollection
- the collection whose elements are to be placed into this list.
java.lang.NullPointerException
- if the specified collection is null.Method Detail |
---|
public boolean add(E pElement)
add
in interface java.util.Collection<E>
add
in interface java.util.List<E>
add
in class java.util.AbstractList<E>
public void add(int pIndex, E pElement)
add
in interface java.util.List<E>
add
in class java.util.AbstractList<E>
public boolean addAll(java.util.Collection<? extends E> pCollection)
addAll
in interface java.util.Collection<E>
addAll
in interface java.util.List<E>
addAll
in class java.util.AbstractCollection<E>
public boolean addAll(int pIndex, java.util.Collection<? extends E> pCollection)
addAll
in interface java.util.List<E>
addAll
in class java.util.AbstractList<E>
public boolean addAll(E[] pArray)
pArray
- the elements to be inserted into this list.
public boolean addAll(int pIndex, E[] pArray)
pIndex
- index at which to insert first element
from the specified collection.pArray
- elements to be inserted into this list.
java.lang.IndexOutOfBoundsException
- if index out of range (index
< 0 || index > size()).public boolean addAll(int pIndex, E[] pArray, int pOffset, int pSize)
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.
java.lang.IndexOutOfBoundsException
- if index out of range (index
< 0 || index > size()).public void merge(E[] pArray)
pArray
- the array to mergepublic void setSize(int pSize)
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.
pSize
- the new size of this vector.public void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.List<E>
clear
in class java.util.AbstractList<E>
public boolean contains(java.lang.Object pObject)
contains
in interface java.util.Collection<E>
contains
in interface java.util.List<E>
contains
in class java.util.AbstractCollection<E>
public E get(int pIndex)
get
in interface java.util.List<E>
get
in class java.util.AbstractList<E>
public int indexOf(java.lang.Object pObject)
indexOf
in interface java.util.List<E>
indexOf
in class java.util.AbstractList<E>
public int indexOf(java.lang.Object pObject, int pIndex)
pObject
- element to search for.pIndex
- index at which the search starts.
public boolean containsReference(java.lang.Object pObject)
pObject
- element to search for.
public int indexOfReference(java.lang.Object pObject)
pObject
- element to search for.
public int indexOfReference(java.lang.Object pObject, int pIndex)
pObject
- element to search for.pIndex
- index at which the search starts.
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
isEmpty
in interface java.util.List<E>
isEmpty
in class java.util.AbstractCollection<E>
public int lastIndexOf(java.lang.Object pObject)
lastIndexOf
in interface java.util.List<E>
lastIndexOf
in class java.util.AbstractList<E>
public int lastIndexOf(java.lang.Object pObject, int pIndex)
pObject
- element to search for.pIndex
- index at which the search starts.
public int lastIndexOfReference(java.lang.Object pObject)
pObject
- element to search for.
public int lastIndexOfReference(java.lang.Object pObject, int pIndex)
pObject
- element to search for.pIndex
- index at which the search starts.
public void removeRange(int pFromIndex, int pToIndex)
removeRange
in class java.util.AbstractList<E>
pFromIndex
- index of first element to be removed.pToIndex
- index after last element to be removed.public boolean remove(java.lang.Object pElement)
remove
in interface java.util.Collection<E>
remove
in interface java.util.List<E>
remove
in class java.util.AbstractCollection<E>
public E remove(int pIndex)
remove
in interface java.util.List<E>
remove
in class java.util.AbstractList<E>
public void removeLast()
public boolean removeAll(E[] pArray)
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.
pArray
- elements to be removed from this collection.
java.lang.UnsupportedOperationException
- if the removeAll method
is not supported by this collection.remove(Object)
,
contains(Object)
public void truncate(int pIndex)
pIndex
- the index starting to remove all elements.public E set(int pIndex, E pElement)
set
in interface java.util.List<E>
set
in class java.util.AbstractList<E>
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.List<E>
size
in class java.util.AbstractCollection<E>
public java.util.Enumeration<E> enumeration()
Enumeration
public ArrayUtil<E> clone()
clone
in class java.lang.Object
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
toArray
in class java.util.AbstractCollection<E>
public <T> T[] toArray(T[] pArray)
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
toArray
in class java.util.AbstractCollection<E>
public boolean equals(java.lang.Object pObject)
equals
in interface java.util.Collection<E>
equals
in interface java.util.List<E>
equals
in class java.util.AbstractList<E>
public int hashCode()
hashCode
in interface java.util.Collection<E>
hashCode
in interface java.util.List<E>
hashCode
in class java.util.AbstractList<E>
public static <T> T[] add(T[] pSourceArray, int pIndex, T pElement)
T
- Component Type of Array.pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static <T> T[] add(T[] pSourceArray, T pElement)
T
- Component Type of Array.pSourceArray
- array in which to add.pElement
- element to be inserted.
public static <T> T[] addAll(T[] pSourceArray, int pIndex, T[] pArray)
T
- Component Type of Array.pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static <T> T[] addAll(T[] pSourceArray, T[] pArray)
T
- Component Type of ArraypSourceArray
- array in which to addpArray
- elements to be inserted
public static boolean[] merge(boolean[] pSourceArray, boolean[] pArray)
pSourceArray
- the source arraypArray
- the array to merge
public static float[] merge(float[] pSourceArray, float[] pArray)
pSourceArray
- the source arraypArray
- the array to merge
public static double[] merge(double[] pSourceArray, double[] pArray)
pSourceArray
- the source arraypArray
- the array to merge
public static int[] merge(int[] pSourceArray, int[] pArray)
pSourceArray
- the source arraypArray
- the array to merge
public static long[] merge(long[] pSourceArray, long[] pArray)
pSourceArray
- the source arraypArray
- the array to merge
public static char[] merge(char[] pSourceArray, char[] pArray)
pSourceArray
- the source arraypArray
- the array to merge
public static <T> T[] merge(T[] pSourceArray, T[] pArray)
T
- Component Type of ArraypSourceArray
- the source arraypArray
- the array to merge
public static <T> T[] removeRange(T[] pSourceArray, int pFromIndex, int pToIndex)
T
- Component Type of Array.pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static <T> T[] remove(T[] pSourceArray, int pIndex)
T
- Component Type of Array.pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static <T> T[] removeLast(T[] pSourceArray)
T
- Component Type of Array.pSourceArray
- array in which to delete.
public static <T> T[] remove(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to delete.pObject
- the given element.
public static <T> T[] removeReference(T[] pSourceArray, T pObject)
T
- component Type of Array.pSourceArray
- array in which to delete.pObject
- the given element.
public static <T> T[] removeAll(T[] pSourceArray, T[] pArray)
T
- component type of array.pSourceArray
- the original elements.pArray
- elements to be removed.
public static <T> T[] intersect(T[] pFirstArray, T[] pSecondArray)
T
- component type of array.pFirstArray
- the first set of elements.pSecondArray
- the second set of elements.
public static <T> T[] truncate(T[] pSourceArray, int pIndex)
T
- Component Type of Array.pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static <T> T[] clear(T[] pSourceArray)
T
- Component Type of Array.pSourceArray
- array in which to delete.
public static <T> boolean contains(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.
public static <T> int indexOf(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.
public static <T> int indexOf(T[] pSourceArray, T pObject, int pIndex)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static <T> int indexOf(T[] pSourceArray, T pObject, int pIndex, int pLength)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.pLength
- length of the source array
public static <T> boolean containsReference(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.
public static <T> int indexOfReference(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.
public static <T> int indexOfReference(T[] pSourceArray, T pObject, int pIndex)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static <T> int lastIndexOf(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.
public static <T> int lastIndexOf(T[] pSourceArray, T pObject, int pIndex)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static <T> int indexOfReference(java.util.List<T> pSourceList, T pObject)
T
- Component Type of the List.pSourceList
- list in which to search.pObject
- element to search for.
public static <T> int indexOfReference(java.util.List<T> pSourceList, T pObject, int pIndex)
T
- Component Type of the List.pSourceList
- list in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static <T> int lastIndexOf(java.util.List<T> pSourceList, T pObject)
T
- Component Type of the List.pSourceList
- list in which to search.pObject
- element to search for.
public static <T> int lastIndexOf(java.util.List<T> pSourceList, T pObject, int pIndex)
T
- Component Type of the List.pSourceList
- list in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static <T> int lastIndexOfReference(T[] pSourceArray, T pObject)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.
public static <T> int lastIndexOfReference(T[] pSourceArray, T pObject, int pIndex)
T
- Component Type of Array.pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static boolean[] add(boolean[] pSourceArray, int pIndex, boolean pElement)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static boolean[] add(boolean[] pSourceArray, boolean pElement)
pSourceArray
- array in which to add.pElement
- element to be inserted.
public static boolean[] addAll(boolean[] pSourceArray, int pIndex, boolean[] pArray)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static boolean[] addAll(boolean[] pSourceArray, boolean[] pArray)
pSourceArray
- array in which to add.pArray
- elements to be inserted.
public static boolean[] removeRange(boolean[] pSourceArray, int pFromIndex, int pToIndex)
pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static boolean[] remove(boolean[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static boolean[] removeLast(boolean[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean[] truncate(boolean[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static boolean[] clear(boolean[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean contains(boolean[] pSourceArray, boolean pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(boolean[] pSourceArray, boolean pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(boolean[] pSourceArray, boolean pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int lastIndexOf(boolean[] pSourceArray, boolean pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int lastIndexOf(boolean[] pSourceArray, boolean pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static char[] add(char[] pSourceArray, int pIndex, char pElement)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static char[] add(char[] pSourceArray, char pElement)
pSourceArray
- array in which to add.pElement
- element to be inserted.
public static char[] addAll(char[] pSourceArray, int pIndex, char[] pArray)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static char[] addAll(char[] pSourceArray, char[] pArray)
pSourceArray
- array in which to add.pArray
- elements to be inserted.
public static char[] removeRange(char[] pSourceArray, int pFromIndex, int pToIndex)
pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static char[] remove(char[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static char[] removeLast(char[] pSourceArray)
pSourceArray
- array in which to delete.
public static char[] truncate(char[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static char[] clear(char[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean contains(char[] pSourceArray, char pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(char[] pSourceArray, char pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(char[] pSourceArray, char pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int lastIndexOf(char[] pSourceArray, char pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int lastIndexOf(char[] pSourceArray, char pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int[] add(int[] pSourceArray, int pIndex, int pElement)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static int[] add(int[] pSourceArray, int pElement)
pSourceArray
- array in which to add.pElement
- element to be inserted.
public static int[] addAll(int[] pSourceArray, int pIndex, int[] pArray)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static int[] addAll(int[] pSourceArray, int[] pArray)
pSourceArray
- array in which to add.pArray
- elements to be inserted.
public static int[] removeRange(int[] pSourceArray, int pFromIndex, int pToIndex)
pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static int[] remove(int[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static int[] removeLast(int[] pSourceArray)
pSourceArray
- array in which to delete.
public static int[] truncate(int[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static int[] clear(int[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean contains(int[] pSourceArray, int pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(int[] pSourceArray, int pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(int[] pSourceArray, int pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int lastIndexOf(int[] pSourceArray, int pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int lastIndexOf(int[] pSourceArray, int pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static long[] add(long[] pSourceArray, int pIndex, long pElement)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static long[] add(long[] pSourceArray, long pElement)
pSourceArray
- array in which to add.pElement
- element to be inserted.
public static long[] addAll(long[] pSourceArray, int pIndex, long[] pArray)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static long[] addAll(long[] pSourceArray, long[] pArray)
pSourceArray
- array in which to add.pArray
- elements to be inserted.
public static long[] removeRange(long[] pSourceArray, int pFromIndex, int pToIndex)
pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static long[] remove(long[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static long[] removeLast(long[] pSourceArray)
pSourceArray
- array in which to delete.
public static long[] truncate(long[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static long[] clear(long[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean contains(long[] pSourceArray, long pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(long[] pSourceArray, long pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(long[] pSourceArray, long pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int lastIndexOf(long[] pSourceArray, long pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int lastIndexOf(long[] pSourceArray, long pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static float[] add(float[] pSourceArray, int pIndex, float pElement)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static float[] add(float[] pSourceArray, float pElement)
pSourceArray
- array in which to add.pElement
- element to be inserted.
public static float[] addAll(float[] pSourceArray, int pIndex, float[] pArray)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static float[] addAll(float[] pSourceArray, float[] pArray)
pSourceArray
- array in which to add.pArray
- elements to be inserted.
public static float[] removeRange(float[] pSourceArray, int pFromIndex, int pToIndex)
pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static float[] remove(float[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static float[] removeLast(float[] pSourceArray)
pSourceArray
- array in which to delete.
public static float[] truncate(float[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static float[] clear(float[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean contains(float[] pSourceArray, float pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(float[] pSourceArray, float pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(float[] pSourceArray, float pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int lastIndexOf(float[] pSourceArray, float pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int lastIndexOf(float[] pSourceArray, float pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static double[] add(double[] pSourceArray, int pIndex, double pElement)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pElement
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static double[] add(double[] pSourceArray, double pElement)
pSourceArray
- array in which to add.pElement
- element to be inserted.
public static double[] addAll(double[] pSourceArray, int pIndex, double[] pArray)
pSourceArray
- array in which to add.pIndex
- index at which the specified element is to be inserted.pArray
- elements to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index > size()).public static double[] addAll(double[] pSourceArray, double[] pArray)
pSourceArray
- array in which to add.pArray
- elements to be inserted.
public static double[] removeRange(double[] pSourceArray, int pFromIndex, int pToIndex)
pSourceArray
- array in which to delete.pFromIndex
- the first index.pToIndex
- the last index (not included).
public static double[] remove(double[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index where elements should be deleted.
public static double[] removeLast(double[] pSourceArray)
pSourceArray
- array in which to delete.
public static double[] truncate(double[] pSourceArray, int pIndex)
pSourceArray
- array in which to delete.pIndex
- the index starting to remove all elements.
public static double[] clear(double[] pSourceArray)
pSourceArray
- array in which to delete.
public static boolean contains(double[] pSourceArray, double pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(double[] pSourceArray, double pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int indexOf(double[] pSourceArray, double pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static int lastIndexOf(double[] pSourceArray, double pObject)
pSourceArray
- array in which to search.pObject
- element to search for.
public static int lastIndexOf(double[] pSourceArray, double pObject, int pIndex)
pSourceArray
- array in which to search.pObject
- element to search for.pIndex
- index at which the search starts.
public static <T> boolean containsAll(T[] pSource, T[] pElements)
T
- Component Type of ArraypSource
- the source arraypElements
- the elements to find
true
if the source array contains all elements, false
otherwise
java.lang.NullPointerException
- if the source array is nullpublic static <T> boolean containsOne(T[] pSource, T[] pElements)
T
- Component Type of ArraypSource
- the source arraypElements
- the elements to find
true
if the source array contains at least one element, false
otherwise
java.lang.NullPointerException
- if the source array is nullpublic boolean containsAll(E[] pElements)
pElements
- the elements to find
true
if the current array contains all elements, false
otherwisepublic boolean containsOne(E[] pElements)
pElements
- the elements to find
true
if the current array contains at least one element, false
otherwisepublic E[] toArray(int pStart, int pLength)
pStart
- the start indexpLength
- the length
public E first()
public E last()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |