|
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.Vector
public class Vector
Vector is a variable size contiguous indexable array of Objects. The size of the Vector is the number of Objects it contains. The capacity of the Vector is the number of Objects it can hold.
Objects may be inserted at any position up to the size of the Vector, increasing the size of the Vector. Objects at any position in the Vector may be removed, shrinking the size of the Vector. Objects at any position in the Vector may be replaced, which does not affect the Vector size.
The capacity of a Vector may be specified when the Vector is created. If the capacity of the Vector is exceeded, the capacity is increased, doubling by default.
StringBuffer| Field Summary | |
|---|---|
protected int |
capacityIncrement
How many elements should be added to the vector when it is detected that it needs to grow to accommodate extra entries. |
protected int |
elementCount
The number of elements or the size of the vector. |
protected java.lang.Object[] |
elementData
The elements of the vector. |
| Fields inherited from class oracle.adfnmc.java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
Vector()
Constructs a new Vector using the default capacity. |
|
Vector(Collection collection)
Constructs a new instance of Vector containing the
elements in collection. |
|
Vector(int capacity)
Constructs a new Vector using the specified capacity. |
|
Vector(int capacity,
int capacityIncrement)
Constructs a new Vector using the specified capacity and capacity increment. |
|
| Method Summary | |
|---|---|
void |
add(int location,
java.lang.Object object)
Adds the specified object into this Vector at the specified location. |
boolean |
add(java.lang.Object object)
Adds the specified object at the end of this Vector. |
boolean |
addAll(Collection collection)
Adds the objects in the specified Collection to the end of this Vector. |
boolean |
addAll(int location,
Collection collection)
Inserts the objects in the specified Collection at the specified location in this Vector. |
void |
addElement(java.lang.Object object)
Adds the specified object at the end of this Vector. |
int |
capacity()
Answers the number of elements this Vector can hold without growing. |
void |
clear()
Removes all elements from this Vector, leaving it empty. |
java.lang.Object |
clone()
Answers a new Vector with the same elements, size, capacity and capacity increment as this Vector. |
boolean |
contains(java.lang.Object object)
Searches this Vector for the specified object. |
boolean |
containsAll(Collection collection)
Searches this Vector for all objects in the specified Collection. |
void |
copyInto(java.lang.Object[] elements)
Attempts to copy elements contained by this Vector into
the corresponding elements of the supplied Object array. |
java.lang.Object |
elementAt(int location)
Answers the element at the specified location in this Vector. |
java.util.Enumeration |
elements()
Answers an Enumeration on the elements of this Vector. |
void |
ensureCapacity(int minimumCapacity)
Ensures that this Vector can hold the specified number of elements without growing. |
boolean |
equals(java.lang.Object object)
Compares the specified object to this Vector and answer if they are equal. |
java.lang.Object |
firstElement()
Answers the first element in this Vector. |
java.lang.Object |
get(int location)
Answers the element at the specified location in this Vector. |
int |
hashCode()
Answers an integer hash code for the receiver. |
int |
indexOf(java.lang.Object object)
Searches in this Vector for the index of the specified object. |
int |
indexOf(java.lang.Object object,
int location)
Searches in this Vector for the index of the specified object. |
void |
insertElementAt(java.lang.Object object,
int location)
Inserts the specified object into this Vector at the specified location. |
boolean |
isEmpty()
Answers if this Vector has no elements, a size of zero. |
java.lang.Object |
lastElement()
Answers the last element in this Vector. |
int |
lastIndexOf(java.lang.Object object)
Searches in this Vector for the index of the specified object. |
int |
lastIndexOf(java.lang.Object object,
int location)
Searches in this Vector for the index of the specified object. |
java.lang.Object |
remove(int location)
Removes the object at the specified location from this List. |
boolean |
remove(java.lang.Object object)
Removes the first occurrence, starting at the beginning and moving towards the end, of the specified object from this Vector. |
boolean |
removeAll(Collection collection)
Removes all occurrences in this Vector of each object in the specified Collection. |
void |
removeAllElements()
Removes all elements from this Vector, leaving the size zero and the capacity unchanged. |
boolean |
removeElement(java.lang.Object object)
Removes the first occurrence, starting at the beginning and moving towards the end, of the specified object from this Vector. |
void |
removeElementAt(int location)
Removes the element found at index position location from
this Vector and decrements the size accordingly. |
protected void |
removeRange(int start,
int end)
Removes the objects in the specified range from the start to the, but not including, end index. |
boolean |
retainAll(Collection collection)
Removes all objects from this Vector that are not contained in the specified Collection. |
java.lang.Object |
set(int location,
java.lang.Object object)
Replaces the element at the specified location in this Vector with the specified object. |
void |
setElementAt(java.lang.Object object,
int location)
Replaces the element at the specified location in this Vector with the specified object. |
void |
setSize(int length)
Sets the size of this Vector to the specified size. |
int |
size()
Answers the number of elements in this Vector. |
List |
subList(int start,
int end)
Answers a List of the specified portion of this Vector from the start index to one less than the end index. |
java.lang.Object[] |
toArray()
Answers a new array containing all elements contained in this Vector. |
java.lang.Object[] |
toArray(java.lang.Object[] contents)
Answers an array containing all elements contained in this Vector. |
java.lang.String |
toString()
Answers the string representation of this Vector. |
void |
trimToSize()
Sets the capacity of this Vector to be the same as the size. |
| Methods inherited from class oracle.adfnmc.java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface oracle.adfnmc.java.util.List |
|---|
iterator, listIterator, listIterator |
| Field Detail |
|---|
protected int elementCount
protected java.lang.Object[] elementData
protected int capacityIncrement
| Constructor Detail |
|---|
public Vector()
public Vector(int capacity)
capacity - the initial capacity of the new vector
public Vector(int capacity,
int capacityIncrement)
capacity - the initial capacity of the new VectorcapacityIncrement - the amount to increase the capacity when this Vector is fullpublic Vector(Collection collection)
Vector containing the
elements in collection. The order of the elements in the
new Vector is dependent on the iteration order of the seed
collection.
collection - the collection of elements to add| Method Detail |
|---|
public void add(int location,
java.lang.Object object)
add in interface Listadd in class AbstractListlocation - the index at which to insert the elementobject - the object to insert in this Vector
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || > size()addElement(java.lang.Object),
size()public boolean add(java.lang.Object object)
add in interface Collectionadd in interface Listadd in class AbstractListobject - the object to add to the Vector
public boolean addAll(int location,
Collection collection)
addAll in interface ListaddAll in class AbstractListlocation - the location to insert the objectscollection - the Collection of objects
java.lang.ArrayIndexOutOfBoundsException - when location < 0 or
location > size()public boolean addAll(Collection collection)
addAll in interface CollectionaddAll in interface ListaddAll in class AbstractCollectioncollection - the Collection of objects
public void addElement(java.lang.Object object)
object - the object to add to the Vectorpublic int capacity()
ensureCapacity(int),
size()public void clear()
clear in interface Collectionclear in interface Listclear in class AbstractListisEmpty(),
size()
public java.lang.Object clone()
throws CloneNotSupportedException
CloneNotSupportedExceptionCloneablepublic boolean contains(java.lang.Object object)
contains in interface Collectioncontains in interface Listcontains in class AbstractCollectionobject - the object to look for in this Vector
indexOf(Object),
indexOf(Object, int),
Object.equals(java.lang.Object)public boolean containsAll(Collection collection)
containsAll in interface CollectioncontainsAll in interface ListcontainsAll in class AbstractCollectioncollection - the Collection of objects
public void copyInto(java.lang.Object[] elements)
Vector into
the corresponding elements of the supplied Object array.
elements - the Object array into which the elements of
this Vector are copiedclone()public java.lang.Object elementAt(int location)
location - the index of the element to return in this Vector
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || >= size()size()public java.util.Enumeration elements()
elementAt(int),
Enumerationpublic void ensureCapacity(int minimumCapacity)
minimumCapacity - the minimum number of elements that this vector will hold
before growingcapacity()public boolean equals(java.lang.Object object)
equals in interface Collectionequals in interface Listequals in class AbstractListobject - the object to compare with this object
hashCode()public java.lang.Object firstElement()
java.util.NoSuchElementException - when this vector is emptyelementAt(int),
lastElement(),
size()public java.lang.Object get(int location)
get in interface Listget in class AbstractListlocation - the index of the element to return in this Vector
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || >= size()size()public int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in class AbstractListequals(java.lang.Object)public int indexOf(java.lang.Object object)
indexOf in interface ListindexOf in class AbstractListobject - the object to find in this Vector
contains(java.lang.Object),
lastIndexOf(Object),
lastIndexOf(Object, int)
public int indexOf(java.lang.Object object,
int location)
object - the object to find in this Vectorlocation - the index at which to start searching
java.lang.ArrayIndexOutOfBoundsException - when location < 0contains(java.lang.Object),
lastIndexOf(Object),
lastIndexOf(Object, int)
public void insertElementAt(java.lang.Object object,
int location)
object - the object to insert in this Vectorlocation - the index at which to insert the element
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || > size()addElement(java.lang.Object),
size()public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListisEmpty in class AbstractCollectionsize()public java.lang.Object lastElement()
java.util.NoSuchElementException - when this vector is emptyelementAt(int),
firstElement(),
size()public int lastIndexOf(java.lang.Object object)
lastIndexOf in interface ListlastIndexOf in class AbstractListobject - the object to find in this Vector
contains(java.lang.Object),
indexOf(Object),
indexOf(Object, int)
public int lastIndexOf(java.lang.Object object,
int location)
object - the object to find in this Vectorlocation - the index at which to start searching
java.lang.ArrayIndexOutOfBoundsException - when location >= size()contains(java.lang.Object),
indexOf(Object),
indexOf(Object, int)public java.lang.Object remove(int location)
AbstractList
remove in interface Listremove in class AbstractListlocation - the index of the object to remove
public boolean remove(java.lang.Object object)
remove in interface Collectionremove in interface Listremove in class AbstractCollectionobject - the object to remove from this Vector
removeAllElements(),
removeElementAt(int),
size()public boolean removeAll(Collection collection)
removeAll in interface CollectionremoveAll in interface ListremoveAll in class AbstractCollectioncollection - the Collection of objects to remove
public void removeAllElements()
isEmpty(),
size()public boolean removeElement(java.lang.Object object)
object - the object to remove from this Vector
removeAllElements(),
removeElementAt(int),
size()public void removeElementAt(int location)
location from
this Vector and decrements the size accordingly.
location - the index of the element to remove
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || >= size()removeElement(java.lang.Object),
removeAllElements(),
size()
protected void removeRange(int start,
int end)
removeRange in class AbstractListstart - 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 boolean retainAll(Collection collection)
retainAll in interface CollectionretainAll in interface ListretainAll in class AbstractCollectioncollection - the Collection of objects to retain
public java.lang.Object set(int location,
java.lang.Object object)
set in interface Listset in class AbstractListlocation - the index at which to put the specified objectobject - the object to add to this Vector
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || >= size()size()
public void setElementAt(java.lang.Object object,
int location)
object - the object to add to this Vectorlocation - the index at which to put the specified object
java.lang.ArrayIndexOutOfBoundsException - when location < 0 || >= size()size()public void setSize(int length)
length - the new size of this Vectorsize()public int size()
size in interface Collectionsize in interface Listsize in class AbstractCollectionelementCount,
lastElement()
public List subList(int start,
int end)
subList in interface ListsubList in class AbstractListstart - the index at which to start the sublistend - the index one past the end of the sublist
java.lang.IndexOutOfBoundsException - when start < 0 or end > size()
java.lang.IllegalArgumentException - when start > endpublic java.lang.Object[] toArray()
toArray in interface CollectiontoArray in interface ListtoArray in class AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] contents)
toArray in interface CollectiontoArray in class AbstractCollectioncontents - the array
java.lang.ArrayStoreException - when the type of an element in this Vector cannot be
stored in the type of the specified arraypublic java.lang.String toString()
toString in class AbstractCollectionelements()public void trimToSize()
capacity(),
ensureCapacity(int),
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 | ||||||||