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
elementData
protected Object[] elementData
elementCount
protected int elementCount
capacityIncrement
protected int capacityIncrement
Vector
public Vector(int,
int)
Vector
public Vector(int)
Vector
public Vector()
Vector
public Vector(Collection)
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