API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Vector View Source
Author(s)
Lee Boynton
Jonathan Payne
Since
JDK1.0
Version
1.106, 06/16/06
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractList
              Vector
Implements
 List
 RandomAccess
 Cloneable
 Serializable
Subclasses
 Stack
Description
public class Vector
  The Vector class implements a growable array of objects.
Constructors
public Vector ()
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.
public Vector (Collection<Object> c)
  Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.
public Vector (int initialCapacity)
  Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero.
public Vector (int initialCapacity, int capacityIncrement)
  Constructs an empty vector with the specified initial capacity and capacity increment.
Methods
Hide/Show inherited methods
publicsynchronized boolean add ( E e) [Overrides AbstractList] [Specified in List]
  Appends the specified element to the end of this Vector.
public void add (int index, E element) [Overrides AbstractList] [Specified in List]
  Inserts the specified element at the specified position in this Vector.
publicsynchronized boolean addAll (Collection<Object> c) [Overrides AbstractCollection] [Specified in List]
  Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator.
publicsynchronized boolean addAll (int index, Collection<Object> c) [Overrides AbstractList] [Specified in List]
  Inserts all of the elements in the specified Collection into this Vector at the specified position.
publicsynchronized void addElement ( E obj)
  Adds the specified component to the end of this vector, increasing its size by one.
publicsynchronized int capacity ()
  Returns the current capacity of this vector.
public void clear () [Overrides AbstractList] [Specified in List]
  Removes all of the elements from this Vector.
publicsynchronized Object clone ()
  Returns a clone of this vector.
public boolean contains (Object o) [Overrides AbstractCollection] [Specified in List]
  Returns true if this vector contains the specified element.
publicsynchronized boolean containsAll (Collection<Object> c) [Overrides AbstractCollection] [Specified in List]
  Returns true if this Vector contains all of the elements in the specified Collection.
publicsynchronized void copyInto (Object anArray)
  Copies the components of this vector into the specified array.
publicsynchronized E elementAt (int index)
  Returns the component at the specified index.
public Enumeration< E> elements ()
  Returns an enumeration of the components of this vector.
publicsynchronized void ensureCapacity (int minCapacity)
  Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
publicsynchronized boolean equals (Object o) [Overrides AbstractList] [Specified in List]
  Compares the specified Object with this Vector for equality.
publicsynchronized E firstElement ()
  Returns the first component (the item at index 0) of this vector.
publicsynchronized E get (int index) [Specified in List]
  Returns the element at the specified position in this Vector.
publicsynchronized int hashCode () [Overrides AbstractList] [Specified in List]
Returns the hash code value for this Vector.
public int indexOf (Object o) [Overrides AbstractList] [Specified in List]
  Returns the index of the first occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
publicsynchronized int indexOf (Object o, int index)
  Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found.
publicsynchronized void insertElementAt ( E obj, int index)
  Inserts the specified object as a component in this vector at the specified index.
publicsynchronized boolean isEmpty () [Overrides AbstractCollection] [Specified in List]
  Tests if this vector has no components.
public Iterator< E> iterator () [Inherited From AbstractList] [Specified in AbstractCollection]
  Returns an iterator over the elements in this list in proper sequence.
publicsynchronized E lastElement ()
  Returns the last component of the vector.
publicsynchronized int lastIndexOf (Object o) [Overrides AbstractList] [Specified in List]
  Returns the index of the last occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
publicsynchronized int lastIndexOf (Object o, int index)
  Returns the index of the last occurrence of the specified element in this vector, searching backwards from index, or returns -1 if the element is not found.
public ListIterator< E> listIterator () [Inherited From AbstractList]
  Returns a list iterator over the elements in this list (in proper sequence).
public ListIterator< E> listIterator (int index) [Inherited From AbstractList]
  Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
publicsynchronized E remove (int index) [Overrides AbstractList] [Specified in List]
  Removes the element at the specified position in this Vector.
public boolean remove (Object o) [Overrides AbstractCollection] [Specified in List]
  Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged.
publicsynchronized boolean removeAll (Collection<Object> c) [Overrides AbstractCollection] [Specified in List]
  Removes from this Vector all of its elements that are contained in the specified Collection.
publicsynchronized void removeAllElements ()
  Removes all components from this vector and sets its size to zero.
publicsynchronized boolean removeElement (Object obj)
  Removes the first (lowest-indexed) occurrence of the argument from this vector.
publicsynchronized void removeElementAt (int index)
  Deletes the component at the specified index.
protectedsynchronized void removeRange (int fromIndex, int toIndex) [Overrides AbstractList]
  Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
publicsynchronized boolean retainAll (Collection<Object> c) [Overrides AbstractCollection] [Specified in List]
  Retains only the elements in this Vector that are contained in the specified Collection.
publicsynchronized E set (int index, E element) [Overrides AbstractList] [Specified in List]
  Replaces the element at the specified position in this Vector with the specified element.
publicsynchronized void setElementAt ( E obj, int index)
  Sets the component at the specified index of this vector to be the specified object.
publicsynchronized void setSize (int newSize)
  Sets the size of this vector.
publicsynchronized int size () [Specified in List]
  Returns the number of components in this vector.
publicsynchronized List< E> subList (int fromIndex, int toIndex) [Overrides AbstractList] [Specified in List]
  Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
publicsynchronized Object toArray () [Overrides AbstractCollection] [Specified in List]
  Returns an array containing all of the elements in this Vector in the correct order.
publicsynchronized T toArray ( T a) [Overrides AbstractCollection] [Specified in List]
  Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array.
publicsynchronized String toString () [Overrides AbstractCollection]
Returns a string representation of this Vector, containing the String representation of each element.
publicsynchronized void trimToSize ()
  Trims the capacity of this vector to be the vector's current size.
Fields
Hide/Show inherited fields
protected int capacityIncrement
  The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity.
protected int elementCount
  The number of valid components in this Vector object.
protected Object elementData
  The array buffer into which the components of the vector are stored.
protectedtransient int modCount [Inherited From AbstractList]
  The number of times this list has been structurally modified.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar