java.util
Class Vector<E>

java.lang.Object
  extended by java.util.Vector<E>
Direct Known Subclasses:
Queue, Stack

public class Vector<E>
extends Object

A dynamic array.


Field Summary
protected  int capacityIncrement
           
protected  int elementCount
           
protected  Object[] elementData
           
 
Constructor Summary
Vector()
           
Vector(int initialCapacity)
           
Vector(int initialCapacity, int capacityIncrement)
           
 
Method Summary
 void addElement(E aObj)
           
 int capacity()
           
 void clear()
           
 E elementAt(int aIndex)
           
 Enumeration<E> elements()
          Returns a convenient Enumaration object to cycle through elements in Vector.
 void ensureCapacity(int minCapacity)
           
 boolean equals(Object aObj)
           
 int indexOf(Object aObj)
           
 int indexOf(Object aObj, int aIndex)
           
 void insertElementAt(E aObj, int aIndex)
           
 boolean isEmpty()
           
 int lastIndexOf(Object anObject)
          delivers the index of the last occurrence of the object
 int lastIndexOf(Object anObject, int anIndex)
          delivers the index of the last occurrence of the object starting from some index
 void removeAllElements()
           
 boolean removeElement(E aObj)
           
 void removeElementAt(int aIndex)
           
 void setElementAt(E aObj, int aIndex)
           
 void setSize(int aSize)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] dest)
           
 String toString()
           
 void trimToSize()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elementData

protected Object[] elementData

capacityIncrement

protected int capacityIncrement

elementCount

protected int elementCount
Constructor Detail

Vector

public Vector()

Vector

public Vector(int initialCapacity)

Vector

public Vector(int initialCapacity,
              int capacityIncrement)
Method Detail

elements

public Enumeration<E> elements()
Returns a convenient Enumaration object to cycle through elements in Vector.

Returns:
an Enumeration of all the objects in the Vector

addElement

public void addElement(E aObj)

capacity

public int capacity()

clear

public void clear()

elementAt

public E elementAt(int aIndex)

ensureCapacity

public void ensureCapacity(int minCapacity)

equals

public boolean equals(Object aObj)
Overrides:
equals in class Object

indexOf

public int indexOf(Object aObj)

indexOf

public int indexOf(Object aObj,
                   int aIndex)

insertElementAt

public void insertElementAt(E aObj,
                            int aIndex)

isEmpty

public boolean isEmpty()

lastIndexOf

public int lastIndexOf(Object anObject)
delivers the index of the last occurrence of the object

Parameters:
anObject - the object
Returns:
the index of the last occurrence of the object or -1, if object is not found

lastIndexOf

public int lastIndexOf(Object anObject,
                       int anIndex)
                throws ArrayIndexOutOfBoundsException
delivers the index of the last occurrence of the object starting from some index

Parameters:
anObject - the object
anIndex - the starting index
Returns:
the index of the last occurrence of the object or -1, if object is not found
Throws:
ArrayIndexOutOfBoundsException

removeAllElements

public void removeAllElements()

removeElement

public boolean removeElement(E aObj)

removeElementAt

public void removeElementAt(int aIndex)

setElementAt

public void setElementAt(E aObj,
                         int aIndex)

setSize

public void setSize(int aSize)

size

public int size()

toArray

public Object[] toArray()

toArray

public <T> T[] toArray(T[] dest)

toString

public String toString()
Overrides:
toString in class Object

trimToSize

public void trimToSize()