|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbyucc.jhdl.synth.graph.VectorIterator
A simple object that contains a vector and implements the IndexedIterator interface for the objects in that vector.
| Constructor Summary | |
VectorIterator(java.util.Vector v)
Construct a new VectorIterator from an existing Vector object. |
|
| Method Summary | |
boolean |
deleteElt()
Delete the object currently pointed at by the iterator. |
boolean |
deleteEltAt(int index)
Delete the object that has the given index. |
GenericIterator |
first()
Move this iterator's "pointer" to the first element in the series. |
java.lang.Object |
getElt()
Retrieves the object currently pointed at by the iterator. |
java.lang.Object |
getEltAt(int index)
Retrieves the object at the given index. |
boolean |
isValid()
Checks if the iterator currently points to a valid item in the series. |
GenericIterator |
last()
Move this iterator's "pointer" to the last element in the series. |
boolean |
moveTo(int index)
Moves the iterator to the element with the given index. |
boolean |
moveTo(java.lang.Object elt)
Moves the iterator to the specified element. |
GenericIterator |
next()
Moves the iterator to the next element in the series. |
GenericIterator |
prev()
Moves the iterator to the previous element in the series. |
int |
size()
Returns the number of elements in the series. |
java.lang.String |
toString()
Get a String representation of this VectorIterator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public VectorIterator(java.util.Vector v)
| Method Detail |
public GenericIterator first()
first in interface GenericIteratorpublic GenericIterator last()
last in interface GenericIteratorpublic boolean isValid()
isValid in interface GenericIteratorpublic GenericIterator next()
next in interface GenericIteratorpublic GenericIterator prev()
prev in interface GenericIteratorpublic boolean moveTo(java.lang.Object elt)
moveTo in interface GenericIteratorpublic boolean moveTo(int index)
moveTo in interface IndexedIteratorindex - an index in the range of 0 <= index < size()
public java.lang.Object getElt()
getElt in interface GenericIteratorpublic java.lang.Object getEltAt(int index)
getEltAt in interface IndexedIteratorindex - an index in the range of 0 <= index < size()
public boolean deleteElt()
Also Note: Any modifications of the series of elements, (ie. deletes or modifications), other than through this iterator may cause undefined effects on the state of this iterator.
Finally, this method deletes the current element using Vector.removeElementAt(current) and then calls prev() to move the pointer to the correct place. Subclasses of VectorIterator may depend on this call to prev(), wcich can of course be overrriden.
deleteElt in interface GenericIteratorpublic boolean deleteEltAt(int index)
Also Note: Any modifications of the series of elements, (ie. deletes or modifications), other than through this iterator may cause undefined effects on the state of this iterator.
deleteEltAt in interface IndexedIteratorindex - the index of an element in the series to delete,
index should be in the range 0 <= index < size()
public int size()
size in interface IndexedIteratorpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||