|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<T> scale.common.Vector<T>
public class Vector<T>
Implement our own Vector class that is un-synchronized and allows us to collect statictics on the number of Vectors in use.
$Id: Vector.java,v 1.19 2007-10-04 19:58:11 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
Vector()
Constructs an empty vector. |
|
Vector(java.util.Collection<T> set)
Constructs an empty vector. |
|
Vector(int initialCapacity)
Constructs an empty vector with the specified initial capacity. |
|
Vector(int initialCapacity,
int dummy)
Constructs an empty vector with the specified initial capacity. |
Method Summary | |
---|---|
void |
addElement(T element)
Add the element to the end of the vector. |
void |
addVectors(java.util.Enumeration<T> e)
Add the elements of an enumeration to this Vector. |
void |
addVectors(T[] c)
Add the elements of an array to this Vector. |
void |
addVectors(Vector<T> c)
Add the elements of a Vector to this vector. |
Vector<T> |
clone()
Returns a clone of this vector. |
T |
elementAt(int i)
Return the specified element. |
java.util.Enumeration<T> |
elements()
Returns an enumeration of the components of this vector. |
T |
firstElement()
Returns the first component (the item at index 0) of this vector. |
void |
insertElementAt(T element,
int i)
Inserts the specified object as a component in this vector at the specified index. |
T |
lastElement()
Returns the last component of the vector. |
void |
removeAllElements()
Removes all components from this vector and sets its size to zero. |
boolean |
removeElement(java.lang.Object element)
Removes the first (lowest-indexed) occurrence of the argument from this vector. |
T |
removeElementAt(int i)
Deletes the component at the specified index. |
void |
reverse()
Revrese the order of the elements in the Vector. |
void |
setElementAt(T element,
int i)
Sets the component at the specified index of this vector to be the specified object. |
void |
setSize(int newSize)
Sets the size of this vector. |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public Vector(int initialCapacity)
initialCapacity
- the initial capacity of the vector.public Vector(int initialCapacity, int dummy)
initialCapacity
- the initial capacity of the vector.public Vector()
public Vector(java.util.Collection<T> set)
Method Detail |
---|
public Vector<T> clone()
clone
in class java.util.ArrayList<T>
public final void setSize(int newSize)
public final T elementAt(int i)
public final void addElement(T element)
public final void insertElementAt(T element, int i)
public final void setElementAt(T element, int i)
public final T removeElementAt(int i)
public final void removeAllElements()
public final boolean removeElement(java.lang.Object element)
public final T firstElement()
public final T lastElement()
public final java.util.Enumeration<T> elements()
public final void addVectors(T[] c)
public final void addVectors(Vector<T> c)
public final void addVectors(java.util.Enumeration<T> e)
public final void reverse()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |