java.util
Class Vector

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, java.io.Serializable
Direct Known Subclasses:
Stack

public synchronized class Vector
extends AbstractList
implements List, RandomAccess, Cloneable, java.io.Serializable


Field Summary
protected  int capacityIncrement
           
protected  int elementCount
           
protected  Object[] elementData
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Vector()
           
Vector(Collection)
           
Vector(int)
           
Vector(int, int)
           
 
Method Summary
 void add(int, Object)
           
 boolean add(Object)
           
 boolean addAll(Collection)
           
 boolean addAll(int, Collection)
           
 void addElement(Object)
           
 int capacity()
           
 void clear()
           
 Object clone()
           
 boolean contains(Object)
           
 boolean containsAll(Collection)
           
 void copyInto(Object[])
           
 Object elementAt(int)
           
 Enumeration elements()
           
 void ensureCapacity(int)
           
 boolean equals(Object)
          Determines if this object is "equal" to another object.
 Object firstElement()
           
 Object get(int)
           
 int hashCode()
           
 int indexOf(Object)
           
 int indexOf(Object, int)
           
 void insertElementAt(Object, int)
           
 boolean isEmpty()
           
 Object lastElement()
           
 int lastIndexOf(Object)
           
 int lastIndexOf(Object, int)
           
 Object remove(int)
           
 boolean remove(Object)
           
 boolean removeAll(Collection)
           
 void removeAllElements()
           
 boolean removeElement(Object)
           
 void removeElementAt(int)
           
protected  void removeRange(int, int)
           
 boolean retainAll(Collection)
           
 Object set(int, Object)
           
 void setElementAt(Object, int)
           
 void setSize(int)
           
 int size()
           
 List subList(int, int)
           
 Object[] toArray()
           
 Object[] toArray(Object[])
           
 String toString()
           
 void trimToSize()
           
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

elementData

protected Object[] elementData

elementCount

protected int elementCount

capacityIncrement

protected int capacityIncrement
Constructor Detail

Vector

public Vector(int,
              int)

Vector

public Vector(int)

Vector

public Vector()

Vector

public Vector(Collection)
Method Detail

copyInto

public void copyInto(Object[])

trimToSize

public void trimToSize()

ensureCapacity

public void ensureCapacity(int)

setSize

public void setSize(int)

capacity

public int capacity()

size

public int size()
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class AbstractCollection

elements

public Enumeration elements()

contains

public boolean contains(Object)
Specified by:
contains in interface List
Overrides:
contains in class AbstractCollection

indexOf

public int indexOf(Object)
Specified by:
indexOf in interface List
Overrides:
indexOf in class AbstractList

indexOf

public int indexOf(Object,
                   int)

lastIndexOf

public int lastIndexOf(Object)
Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class AbstractList

lastIndexOf

public int lastIndexOf(Object,
                       int)

elementAt

public Object elementAt(int)

firstElement

public Object firstElement()

lastElement

public Object lastElement()

setElementAt

public void setElementAt(Object,
                         int)

removeElementAt

public void removeElementAt(int)

insertElementAt

public void insertElementAt(Object,
                            int)

addElement

public void addElement(Object)

removeElement

public boolean removeElement(Object)

removeAllElements

public void removeAllElements()

clone

public Object clone()

toArray

public Object[] toArray()
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection

toArray

public Object[] toArray(Object[])
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection

get

public Object get(int)
Specified by:
get in interface List
Specified by:
get in class AbstractList

set

public Object set(int,
                  Object)
Specified by:
set in interface List
Overrides:
set in class AbstractList

add

public boolean add(Object)
Specified by:
add in interface List
Overrides:
add in class AbstractList

remove

public boolean remove(Object)
Specified by:
remove in interface List
Overrides:
remove in class AbstractCollection

add

public void add(int,
                Object)
Specified by:
add in interface List
Overrides:
add in class AbstractList

remove

public Object remove(int)
Specified by:
remove in interface List
Overrides:
remove in class AbstractList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class AbstractList

containsAll

public boolean containsAll(Collection)
Specified by:
containsAll in interface List
Overrides:
containsAll in class AbstractCollection

addAll

public boolean addAll(Collection)
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractCollection

removeAll

public boolean removeAll(Collection)
Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractCollection

retainAll

public boolean retainAll(Collection)
Specified by:
retainAll in interface List
Overrides:
retainAll in class AbstractCollection

addAll

public boolean addAll(int,
                      Collection)
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractList

equals

public boolean equals(Object)
Description copied from class: Object
Determines if this object is "equal" to another object.

In general, objects should be instances of the same class with the same guts to be considered equal. For example, the code below only prints same value since s and t are different strings though they have the same value: "hello".

 String s = new String("hello");
 String t = new String("hello");
 if (s.equals(t)) System.out.println("same value");
 if (s == t) System.out.println("same string");

 

Specified by:
equals in interface List
Overrides:
equals in class AbstractList
Following copied from class: java.lang.Object
Parameters:
is - the other Object to which this one is compared
Returns:
true if this Object is equal to other

hashCode

public int hashCode()
Specified by:
hashCode in interface List
Overrides:
hashCode in class AbstractList

toString

public String toString()
Overrides:
toString in class AbstractCollection

subList

public List subList(int,
                    int)
Specified by:
subList in interface List
Overrides:
subList in class AbstractList

removeRange

protected void removeRange(int,
                           int)
Overrides:
removeRange in class AbstractList