|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jds.collection.IndexedDeque
IndexedDeque - Deque implemented in the fashion of a Vector; for use with book Classic Data Structures in Java by Timothy A Budd, published by Addison-Wesley, 2001.
jds.Vector
, Serialized FormConstructor Summary | |
IndexedDeque()
|
Method Summary | |
void |
addElementAt(java.lang.Object val,
int index)
add a new element into the collection, making collection one element larger |
void |
addFirst(java.lang.Object val)
add a new value to front of the collection |
void |
addLast(java.lang.Object val)
add a new value to end of the collection |
int |
capacity()
capacity return the capacity of this structure |
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 that buffer has sufficient capacity |
java.lang.Object |
getFirst()
access the first value in collection |
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 |
removeFirst()
remove first value in collection |
void |
removeLast()
remove last value in collection |
void |
setElementAt(java.lang.Object val,
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 IndexedDeque()
Method Detail |
public boolean isEmpty()
public int size()
public java.util.Enumeration elements()
Enumeration
that will yield the elements of the collectionEnumeration
public java.lang.Object elementAt(int index)
index
- the index of the desired valuepublic void setElementAt(java.lang.Object val, int index)
v
- the value to be insertedindex
- the position at which value will be insertedpublic void setSize(int newSize)
size
- the new size of the collectionpublic int capacity()
public void ensureCapacity(int newCapacity)
newCapacity
- proposed new capacity of bufferpublic 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 java.lang.Object getFirst()
public java.lang.Object getLast()
public void addLast(java.lang.Object val)
value
- element to be inserted into collectionpublic void addFirst(java.lang.Object val)
value
- element to be inserted into collectionpublic void removeLast()
public void removeFirst()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |