|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.adfnmc.java.util.AbstractCollection
oracle.adfnmc.java.util.AbstractList
oracle.adfnmc.java.util.ArrayList
public class ArrayList
ArrayList is an implementation of List, backed by an array. All optional operations are supported, adding, removing, and replacing. The elements can be any objects.
Field Summary |
---|
Fields inherited from class oracle.adfnmc.java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
ArrayList()
Constructs a new instance of ArrayList with capacity for ten elements. |
|
ArrayList(Collection collection)
Constructs a new instance of ArrayList containing the elements in the specified collection. |
|
ArrayList(int capacity)
Constructs a new instance of ArrayList with the specified capacity. |
|
ArrayList(Vector vec)
Constructs a new instance of ArrayList containing the elements in the specified vector. |
Method Summary | |
---|---|
void |
add(int location,
java.lang.Object object)
Inserts the specified object into this ArrayList at the specified location. |
boolean |
add(java.lang.Object object)
Adds the specified object at the end of this ArrayList. |
boolean |
addAll(Collection collection)
Adds the objects in the specified Collection to this ArrayList. |
boolean |
addAll(int location,
Collection collection)
Inserts the objects in the specified Collection at the specified location in this ArrayList. |
void |
clear()
Removes all elements from this ArrayList, leaving it empty. |
java.lang.Object |
clone()
Answers a new ArrayList with the same elements, size and capacity as this ArrayList. |
boolean |
contains(java.lang.Object object)
Searches this ArrayList for the specified object. |
void |
ensureCapacity(int minimumCapacity)
Ensures that this ArrayList can hold the specified number of elements without growing. |
java.lang.Object |
get(int location)
Answers the element at the specified location in this ArrayList. |
int |
indexOf(java.lang.Object object)
Searches this ArrayList for the specified object and returns the index of the first occurrence. |
boolean |
isEmpty()
Answers if this ArrayList has no elements, a size of zero. |
int |
lastIndexOf(java.lang.Object object)
Searches this ArrayList for the specified object and returns the index of the last occurrence. |
java.lang.Object |
remove(int location)
Removes the object at the specified location from this ArrayList. |
boolean |
remove(java.lang.Object object)
Removes the first one of the specified object in this list, if present. |
protected void |
removeRange(int start,
int end)
Removes the objects in the specified range from the start to the end, but not including the end index. |
java.lang.Object |
set(int location,
java.lang.Object object)
Replaces the element at the specified location in this ArrayList with the specified object. |
int |
size()
Answers the number of elements in this ArrayList. |
java.lang.Object[] |
toArray()
Answers a new array containing all elements contained in this ArrayList. |
java.lang.Object[] |
toArray(java.lang.Object[] contents)
Answers an array containing all elements contained in this ArrayList. |
void |
trimToSize()
Sets the capacity of this ArrayList to be the same as the size. |
Methods inherited from class oracle.adfnmc.java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class oracle.adfnmc.java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.adfnmc.java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public ArrayList()
public ArrayList(int capacity)
capacity
- the initial capacity of this ArrayListpublic ArrayList(Collection collection)
collection
- the collection of elements to addpublic ArrayList(Vector vec)
vec
- the vector of elements to addMethod Detail |
---|
public void add(int location, java.lang.Object object)
add
in interface List
add
in class AbstractList
location
- the index at which to insertobject
- the object to add
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public boolean add(java.lang.Object object)
add
in interface Collection
add
in interface List
add
in class AbstractList
object
- the object to add
public boolean addAll(int location, Collection collection)
addAll
in interface List
addAll
in class AbstractList
location
- the index at which to insertcollection
- the Collection of objects
java.lang.IndexOutOfBoundsException
- when location < 0 || > size()
public boolean addAll(Collection collection)
addAll
in interface Collection
addAll
in interface List
addAll
in class AbstractCollection
collection
- the Collection of objects
public void clear()
clear
in interface Collection
clear
in interface List
clear
in class AbstractList
isEmpty()
,
size()
public java.lang.Object clone()
Cloneable
public boolean contains(java.lang.Object object)
contains
in interface Collection
contains
in interface List
contains
in class AbstractCollection
object
- the object to search for
object
is an element of this ArrayList, false otherwisepublic void ensureCapacity(int minimumCapacity)
minimumCapacity
- the minimum number of elements that this ArrayList will hold before growingpublic java.lang.Object get(int location)
get
in interface List
get
in class AbstractList
location
- the index of the element to return
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public int indexOf(java.lang.Object object)
indexOf
in interface List
indexOf
in class AbstractList
object
- the object to search for
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
isEmpty
in class AbstractCollection
size()
public int lastIndexOf(java.lang.Object object)
lastIndexOf
in interface List
lastIndexOf
in class AbstractList
object
- the object to search for
public java.lang.Object remove(int location)
remove
in interface List
remove
in class AbstractList
location
- the index of the object to remove
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public boolean remove(java.lang.Object object)
remove
in interface Collection
remove
in interface List
remove
in class AbstractCollection
object
- the object to removes
java.util.AbstractCollection#remove(java.lang.Object)
protected void removeRange(int start, int end)
removeRange
in class AbstractList
start
- the index at which to start removingend
- the index one past the end of the range to remove
java.lang.IndexOutOfBoundsException
- when start < 0, start > end
or end > size()
public java.lang.Object set(int location, java.lang.Object object)
set
in interface List
set
in class AbstractList
location
- the index at which to put the specified objectobject
- the object to add
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public int size()
size
in interface Collection
size
in interface List
size
in class AbstractCollection
public java.lang.Object[] toArray()
toArray
in interface Collection
toArray
in interface List
toArray
in class AbstractCollection
public java.lang.Object[] toArray(java.lang.Object[] contents)
toArray
in interface Collection
toArray
in class AbstractCollection
contents
- the array
java.lang.ArrayStoreException
- when the type of an element in this ArrayList cannot be stored in the type of the specified arraypublic void trimToSize()
size()
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |