|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jds.collection.Vector
Vector - an indexed collection; for use with book Classic Data Structures in Java by Timothy A Budd, published by Addison-Wesley, 2001.
Collection
, Serialized FormConstructor Summary | |
Vector()
|
Method Summary | |
void |
addElementAt(java.lang.Object val,
int index)
add a new element into the collection, making collection one element larger |
void |
addLast(java.lang.Object val)
add a new value to end of the collection |
java.lang.Object |
elementAt(int index)
find value at specific index location |
java.util.Enumeration |
elements()
Yields enumerator for collection |
void |
ensureCapacity(int newCapacity)
ensure buffer has sufficient number of elements |
java.lang.Object |
getLast()
access the last value in collection |
boolean |
isEmpty()
Determines whether the collection is empty |
void |
removeElementAt(int index)
remove a value from a collection, making collection one element smaller |
void |
removeLast()
remove last value in collection |
void |
setElementAt(java.lang.Object v,
int index)
set value at specific location |
void |
setSize(int newSize)
set number of elements in collection |
int |
size()
Determines number of elements in collection |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Vector()
Method Detail |
public boolean isEmpty()
public int size()
public java.util.Enumeration elements()
Enumeration
that will yield the elements of the collectionEnumeration
public void setSize(int newSize)
size
- the new size of the collectionpublic java.lang.Object elementAt(int index)
index
- the index of the desired valuepublic void setElementAt(java.lang.Object v, int index)
v
- the value to be insertedindex
- the position at which value will be insertedpublic void addElementAt(java.lang.Object val, int index)
val
- the value to be insertedindex
- the position at which value will be inserted, other elements will be moved upwardspublic void removeElementAt(int index)
index
- the index of the element to be removedpublic void addLast(java.lang.Object val)
value
- element to be inserted into collectionpublic java.lang.Object getLast()
public void removeLast()
public void ensureCapacity(int newCapacity)
newCapacity
- capacity of collection after operation
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |