| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractList | +--java.util.Vector | +--edu.unika.aifb.texttoonto.util.Vector
The Vector class implements a growable array of objects. Like an array, it contains components that can be accessed using an integer index. However, the size of a Vector can grow or shrink as needed to accommodate adding and removing items after the Vector has been created. Each vector tries to optimize storage management by maintaining a capacity and a capacityIncrement. The capacity is always at least as large as the vector size; it is usually larger because as components are added to the vector, the vector's storage increases in chunks the size of capacityIncrement. An application can increase the capacity of a vector before inserting a large number of components; this reduces the amount of incremental reallocation. As of JDK1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized. The Iterators returned by Vector's iterator and listIterator methods are fail-fast: if the Vector is structurally modified at any time after the Iterator is created, in any way except through the Iterator's own remove or add methods, the Iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the Iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future. The Enumerations returned by Vector's elements method are not fail-fast.
Constructor Summary | |
Vector() | |
Vector(Object[] array) Creates a new Vector whose contents are the elements of array | |
Vector(int initialCapacity) | |
Vector(int initialCapacity, int capacityIncrement) | |
Vector(Collection c) |
Method Summary | |
boolean | addNotExisting(Object o) Adds |
Vector | difference(Collection to) Returns all elements in this Vector that are not element in Collection to |
Object | get(Object name) Returns an Object that is equal to |
synchronized int | indexOf(Object elem, int index) |
Vector | intersection(Collection with) Returns all elements in this Vector also contained in Collection with |
String | toString() |
Vector | union(Collection with) Joins this Vector with Collection with |
Methods inherited from class java.util.Vector |
copyInto, trimToSize, ensureCapacity, setSize, capacity, size, isEmpty, elements, contains, indexOf, lastIndexOf, lastIndexOf, elementAt, firstElement, lastElement, setElementAt, removeElementAt, insertElementAt, addElement, removeElement, removeAllElements, clone, toArray, toArray, get, set, add, remove, add, remove, clear, containsAll, addAll, removeAll, retainAll, addAll, equals, hashCode, subList |
Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Vector()
public Vector(Object[] array)
public Vector(int initialCapacity)
public Vector(int initialCapacity, int capacityIncrement)
public Vector(Collection c)
Method Detail |
public boolean addNotExisting(Object o)
public Vector difference(Collection to)
to
public Object get(Object name)
public synchronized int indexOf(Object elem, int index)
public Vector intersection(Collection with)
with
public String toString()
public Vector union(Collection with)
with
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |