DthingApi
|
Public Member Functions | |
Vector () | |
Vector (int capacity) | |
Vector (int capacity, int capacityIncrement) | |
Vector (Collection<? extends E > collection) | |
void | add (int location, E object) |
synchronized boolean | add (E object) |
synchronized boolean | addAll (int location, Collection<? extends E > collection) |
synchronized boolean | addAll (Collection<? extends E > collection) |
synchronized void | addElement (E object) |
synchronized int | capacity () |
void | clear () |
synchronized Object | clone () |
boolean | contains (Object object) |
synchronized boolean | containsAll (Collection<?> collection) |
synchronized void | copyInto (Object[] elements) |
synchronized E | elementAt (int location) |
Enumeration< E > | elements () |
synchronized void | ensureCapacity (int minimumCapacity) |
synchronized boolean | equals (Object object) |
synchronized E | firstElement () |
E | get (int location) |
synchronized int | hashCode () |
int | indexOf (Object object) |
synchronized int | indexOf (Object object, int location) |
synchronized void | insertElementAt (E object, int location) |
synchronized boolean | isEmpty () |
synchronized E | lastElement () |
synchronized int | lastIndexOf (Object object) |
synchronized int | lastIndexOf (Object object, int location) |
synchronized E | remove (int location) |
boolean | remove (Object object) |
synchronized boolean | removeAll (Collection<?> collection) |
synchronized void | removeAllElements () |
synchronized boolean | removeElement (Object object) |
synchronized void | removeElementAt (int location) |
synchronized boolean | retainAll (Collection<?> collection) |
synchronized E | set (int location, E object) |
synchronized void | setElementAt (E object, int location) |
synchronized void | setSize (int length) |
synchronized int | size () |
synchronized List< E > | subList (int start, int end) |
synchronized Object [] | toArray () |
synchronized String | toString () |
synchronized void | trimToSize () |
![]() | |
void | add (int location, E object) |
boolean | add (E object) |
boolean | addAll (int location, Collection<? extends E > collection) |
void | clear () |
boolean | equals (Object object) |
abstract E | get (int location) |
int | hashCode () |
int | indexOf (Object object) |
Iterator< E > | iterator () |
int | lastIndexOf (Object object) |
ListIterator< E > | listIterator () |
ListIterator< E > | listIterator (int location) |
E | remove (int location) |
E | set (int location, E object) |
List< E > | subList (int start, int end) |
![]() | |
boolean | add (E object) |
boolean | addAll (Collection<? extends E > collection) |
void | clear () |
boolean | contains (Object object) |
boolean | containsAll (Collection<?> collection) |
boolean | isEmpty () |
abstract Iterator< E > | iterator () |
boolean | remove (Object object) |
boolean | removeAll (Collection<?> collection) |
boolean | retainAll (Collection<?> collection) |
abstract int | size () |
Object [] | toArray () |
String | toString () |
Protected Member Functions | |
void | removeRange (int start, int end) |
![]() | |
AbstractList () | |
void | removeRange (int start, int end) |
![]() | |
AbstractCollection () | |
Protected Attributes | |
int | elementCount |
Object [] | elementData |
int | capacityIncrement |
![]() | |
transient int | modCount |
Vector is an implementation of List, backed by an array and synchronized. All optional operations including adding, removing, and replacing elements are supported.
All elements are permitted, including null.
This class is equivalent to ArrayList with synchronized operations. This has a performance cost, and the synchronization is not necessarily meaningful to your application: synchronizing each call to
, for example, is not equivalent to synchronizing on the list and iterating over it (which is probably what you intended). If you do need very highly concurrent access, you should also consider java.util.concurrent.CopyOnWriteArrayList.
<E> | The element type of this list. |
|
inline |
Constructs a new vector using the default capacity.
|
inline |
Constructs a new vector using the specified capacity.
capacity | the initial capacity of the new vector. |
IllegalArgumentException | if is negative. |
|
inline |
Constructs a new vector using the specified capacity and capacity increment.
capacity | the initial capacity of the new vector. |
capacityIncrement | the amount to increase the capacity when this vector is full. |
IllegalArgumentException | if is negative. |
|
inline |
|
inline |
Adds the specified object into this vector at the specified location. The object is inserted before any element with the same or a higher index increasing their index by 1. If the location is equal to the size of this vector, the object is added at the end.
location | the index at which to insert the element. |
object | the object to insert in this vector. |
ArrayIndexOutOfBoundsException | if location < 0 || location > size() |
Implements java.util.List< E >.
|
inline |
Adds the specified object at the end of this vector.
object | the object to add to the vector. |
Implements java.util.List< E >.
|
inline |
Inserts the objects in the specified collection at the specified location in this vector. The objects are inserted in the order in which they are returned from the Collection iterator. The elements with an index equal or higher than
have their index increased by the size of the added collection.
location | the location to insert the objects. |
collection | the collection of objects. |
ArrayIndexOutOfBoundsException | if location < 0 location > size() |
Implements java.util.List< E >.
|
inline |
Adds the objects in the specified collection to the end of this vector.
collection | the collection of objects. |
Implements java.util.List< E >.
|
inline |
Adds the specified object at the end of this vector.
object | the object to add to the vector. |
|
inline |
Returns the number of elements this vector can hold without growing.
|
inline |
Removes all elements from this vector, leaving it empty.
Implements java.util.List< E >.
|
inline |
Returns a new vector with the same elements, size, capacity and capacity increment as this vector.
|
inline |
Searches this vector for the specified object.
object | the object to look for in this vector. |
Implements java.util.List< E >.
|
inline |
Searches this vector for all objects in the specified collection.
collection | the collection of objects. |
Implements java.util.List< E >.
|
inline |
|
inline |
|
inline |
Returns an enumeration on the elements of this vector. The results of the enumeration may be affected if the contents of this vector is modified.
|
inline |
Ensures that this vector can hold the specified number of elements without growing.
minimumCapacity | the minimum number of elements that this vector will hold before growing. |
|
inline |
Compares the specified object to this vector and returns if they are equal. The object must be a List which contains the same objects in the same order.
object | the object to compare with this object |
Implements java.util.List< E >.
|
inline |
Returns the first element in this vector.
NoSuchElementException | if this vector is empty. |
|
inline |
Returns the element at the specified location in this vector.
location | the index of the element to return in this vector. |
ArrayIndexOutOfBoundsException | if location < 0 || location >= size() |
Implements java.util.List< E >.
|
inline |
Returns an integer hash code for the receiver. Objects which are equal return the same value for this method.
Implements java.util.List< E >.
|
inline |
Searches in this vector for the index of the specified object. The search for the object starts at the beginning and moves towards the end of this vector.
object | the object to find in this vector. |
Implements java.util.List< E >.
|
inline |
Searches in this vector for the index of the specified object. The search for the object starts at the specified location and moves towards the end of this vector.
object | the object to find in this vector. |
location | the index at which to start searching. |
ArrayIndexOutOfBoundsException | if location < 0 |
|
inline |
Inserts the specified object into this vector at the specified location. This object is inserted before any previous element at the specified location. All elements with an index equal or greater than
have their index increased by 1. If the location is equal to the size of this vector, the object is added at the end.
object | the object to insert in this vector. |
location | the index at which to insert the element. |
ArrayIndexOutOfBoundsException | if location < 0 || location > size() |
|
inline |
Returns if this vector has no elements, a size of zero.
Implements java.util.List< E >.
|
inline |
Returns the last element in this vector.
NoSuchElementException | if this vector is empty. |
|
inline |
Searches in this vector for the index of the specified object. The search for the object starts at the end and moves towards the start of this vector.
object | the object to find in this vector. |
Implements java.util.List< E >.
|
inline |
Searches in this vector for the index of the specified object. The search for the object starts at the specified location and moves towards the start of this vector.
object | the object to find in this vector. |
location | the index at which to start searching. |
ArrayIndexOutOfBoundsException | if location >= size() |
|
inline |
Removes the object at the specified location from this vector. All elements with an index bigger than
have their index decreased by 1.
location | the index of the object to remove. |
IndexOutOfBoundsException | if location < 0 || location >= size() |
Implements java.util.List< E >.
|
inline |
Removes the first occurrence, starting at the beginning and moving towards the end, of the specified object from this vector. All elements with an index bigger than the element that gets removed have their index decreased by 1.
object | the object to remove from this vector. |
Implements java.util.List< E >.
|
inline |
Removes all occurrences in this vector of each object in the specified Collection.
collection | the collection of objects to remove. |
Implements java.util.List< E >.
|
inline |
|
inline |
Removes the first occurrence, starting at the beginning and moving towards the end, of the specified object from this vector. All elements with an index bigger than the element that gets removed have their index decreased by 1.
object | the object to remove from this vector. |
|
inline |
Removes the element found at index position
from this
. All elements with an index bigger than
have their index decreased by 1.
location | the index of the element to remove. |
ArrayIndexOutOfBoundsException | if location < 0 || location >= size() |
|
inlineprotected |
Removes the objects in the specified range from the start to the, but not including, end index. All elements with an index bigger than or equal to
have their index decreased by
.
start | the index at which to start removing. |
end | the index one past the end of the range to remove. |
IndexOutOfBoundsException | if start < 0, start > end end > size() |
|
inline |
Removes all objects from this vector that are not contained in the specified collection.
collection | the collection of objects to retain. |
Implements java.util.List< E >.
|
inline |
Replaces the element at the specified location in this vector with the specified object.
location | the index at which to put the specified object. |
object | the object to add to this vector. |
ArrayIndexOutOfBoundsException | if location < 0 || location >= size() |
Implements java.util.List< E >.
|
inline |
|
inline |
Sets the size of this vector to the specified size. If there are more than length elements in this vector, the elements at end are lost. If there are less than length elements in the vector, the additional elements contain null.
length | the new size of this vector. |
|
inline |
Returns the number of elements in this vector.
Implements java.util.List< E >.
|
inline |
Returns a List of the specified portion of this vector from the start index to one less than the end index. The returned List is backed by this vector so changes to one are reflected by the other.
start | the index at which to start the sublist. |
end | the index one past the end of the sublist. |
IndexOutOfBoundsException | if start < 0 end > size() |
IllegalArgumentException | if start > end |
Implements java.util.List< E >.
|
inline |
Returns a new array containing all elements contained in this vector.
Implements java.util.List< E >.
|
inline |
Returns the string representation of this vector.
|
inline |
Sets the capacity of this vector to be the same as the size.
|
protected |
How many elements should be added to the vector when it is detected that it needs to grow to accommodate extra entries. If this value is zero or negative the size will be doubled if an increase is needed.
|
protected |
The number of elements or the size of the vector.
|
protected |
The elements of the vector.