|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openmobileis.common.util.collection.Array
Use to store an Array of objects.
Field Summary | |
protected java.lang.Object[] |
elementData
The array buffer into which the elements of the ArrayList are stored. |
protected static long |
serialVersionUID
|
protected int |
size
The size of the ArrayList (the number of elements it contains). |
Constructor Summary | |
Array()
Constructs an empty ArrayList.Initial capacity is 10 |
|
Array(int initialCapacity)
Constructs an empty ArrayList with the specified initial capacity. |
|
Array(java.lang.Object[] array)
|
Method Summary | |
boolean |
add(int index,
java.lang.Object o)
Appends the specified element to the end of this ArrayList. |
boolean |
add(java.lang.Object o)
Appends the specified element to the end of this ArrayList. |
boolean |
addArray(Array a)
Appends the specified ArrayList to the end of this ArrayList. |
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object o)
return true if the array contains the specified object false otherwise. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument. |
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
get(int index)
Returns the element at the specified position in this ArrayList. |
protected java.lang.Object[] |
getArrayElements()
|
java.lang.Object |
getLastAdded()
return the last added object in the array. |
int |
indexOf(java.lang.Object o)
Searches for the first occurence of the given argument, testing for equality using the equals method. |
boolean |
isEmpty()
Tests if this ArrayList has no elements. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
remove(int index)
Removes the element at the specified position in this ArrayList. |
java.lang.Object |
remove(java.lang.Object element)
Removes the element in this ArrayList. |
void |
removeAll()
|
boolean |
replace(int index,
java.lang.Object o)
replace at the specified index the element. |
protected void |
setArrayElements(java.lang.Object[] array)
|
void |
setSize(int size)
set the size of the array. |
int |
size()
Returns the number of elements in this ArrayList. |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this ArrayList in the correct order. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this ArrayList in the correct order. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final long serialVersionUID
protected java.lang.Object[] elementData
protected int size
Constructor Detail |
public Array(java.lang.Object[] array)
public Array(int initialCapacity)
initialCapacity
- the initial capacity of the ArrayList.
java.lang.IllegalArgumentException
- if the specified initial capacity
is negativepublic Array()
Method Detail |
public void clear()
protected java.lang.Object[] getArrayElements()
protected void setArrayElements(java.lang.Object[] array)
public void ensureCapacity(int minCapacity)
minCapacity
- the desired minimum capacity.public int size()
public void setSize(int size)
public boolean isEmpty()
public java.lang.Object[] toArray()
public java.lang.Object[] toArray(java.lang.Object[] a)
If the ArrayList fits in the specified array with room to spare (i.e., the ArrayList has more elements than the array), the element in the array immediately following the end of the collection is set to null.
a
- the array into which the elements of the ArrayList are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.
java.lang.ArrayStoreException
- if the runtime type of a is not a supertype
of the runtime type of every element in this ArrayList.public java.lang.Object get(int index)
index
- index of element to return.
java.lang.IndexOutOfBoundsException
- if index is out of range (index
< 0 || index >= size()).public boolean add(java.lang.Object o)
add
in interface FilterCollection
o
- element to be appended to this ArrayList.
public boolean replace(int index, java.lang.Object o)
index
- index in the array where element is replaced.o
- element to be replaced to this ArrayList.
public boolean add(int index, java.lang.Object o)
o
- element to be appended to this ArrayList.
public java.lang.Object getLastAdded()
public boolean contains(java.lang.Object o)
public int indexOf(java.lang.Object o)
public boolean addArray(Array a)
a
- ArrayList to be appended to this ArrayList..
public java.lang.Object remove(int index)
index
- the index of the element to removed.
java.lang.IndexOutOfBoundsException
- if index out of range (index
< 0 || index >= size()).public java.lang.Object remove(java.lang.Object element)
element
- to removed.
public void removeAll()
public static void main(java.lang.String[] args)
public java.lang.Object clone()
public boolean equals(java.lang.Object obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |