com.ibm.security12.java.util
Class Vector12
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.Vector
|
+--com.ibm.security12.java.util.Vector12
- public class Vector12
- extends Vector
Vector12 is an improved version of java.util.Vector. JDK 1.2 introduces
several new methods to java.util.Vector, and Vector12 is the implementation
of some of those methods.
- Version:
- 1.1, 98/05/28
- Author:
- D. Kent Soper
- See Also:
- Serialized Form
Constructor Summary |
Vector12()
Creates a Vector12 instance that represents an empty
vector with an internal data array of size 10 and its
standard capacity increment is zero. |
Method Summary |
void |
add(int index,
Object element)
Inserts the specified element at the specified position in this Vector. |
Object |
get(int index)
Returns the element at the specified position in this Vector. |
Object |
remove(int index)
Removes the element at the specified position in this Vector. |
Object |
set(int index,
Object element)
Replaces the element at the specified position in this Vector with the
specified element. |
Methods inherited from class java.util.Vector |
add,
addAll,
addAll,
addElement,
capacity,
clear,
clone,
contains,
containsAll,
copyInto,
elementAt,
elements,
ensureCapacity,
equals,
firstElement,
hashCode,
indexOf,
indexOf,
insertElementAt,
isEmpty,
lastElement,
lastIndexOf,
lastIndexOf,
remove,
removeAll,
removeAllElements,
removeElement,
removeElementAt,
removeRange,
retainAll,
setElementAt,
setSize,
size,
subList,
toArray,
toArray,
toString,
trimToSize |
Vector12
public Vector12()
- Creates a
Vector12
instance that represents an empty
vector with an internal data array of size 10 and its
standard capacity increment is zero.
get
public Object get(int index)
- Returns the element at the specified position in this Vector.
- Parameters:
index
- index of element to return.- Throws:
- ArrayIndexOutOfBoundsException - index is out of range (index
< 0 || index >= size()).
- Overrides:
- get in class Vector
- Since:
- JDK1.2
set
public Object set(int index,
Object element)
- Replaces the element at the specified position in this Vector with the
specified element.
- Parameters:
index
- index of element to replace.element
- element to be stored at the specified position.- Returns:
- the element previously at the specified position.
- Throws:
- ArrayIndexOutOfBoundsException - index out of range
(index < 0 || index >= size()).
- IllegalArgumentException - fromIndex > toIndex.
- Overrides:
- set in class Vector
- Since:
- JDK1.2
add
public void add(int index,
Object element)
- Inserts the specified element at the specified position in this Vector.
Shifts the element currently at that position (if any) and any
subsequent elements to the right (adds one to their indices).
- Parameters:
index
- index at which the specified element is to be inserted.element
- element to be inserted.- Throws:
- ArrayIndexOutOfBoundsException - index is out of range
(index < 0 || index > size()).
- Overrides:
- add in class Vector
- Since:
- JDK1.2
remove
public Object remove(int index)
- Removes the element at the specified position in this Vector.
shifts any subsequent elements to the left (subtracts one from their
indices). Returns the element that was removed from the Vector.
- Parameters:
index
- the index of the element to removed.- Throws:
- ArrayIndexOutOfBoundsException - index out of range (index
< 0 || index >= size()).
- Overrides:
- remove in class Vector
- Since:
- JDK1.2