|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbyucc.jhdl.synth.graph.VectorIterator
byucc.jhdl.synth.graph.VertexVectorIterator
A class to allow a GenericIterator for Vertex objects in a VertexVector. This class simply extends VectorIterator. The constructor guarantees that this will only be constructed with a VertexVector. The VertexIterator interface is also implemented which has some convenient methods for saving class casts as well as performing graph cleanup when deleting vertices.
Constructor Summary | |
VertexVectorIterator(VertexVector vertices)
Construct a new VertexVectorIterator from an existing VertexVector. |
Method Summary | |
boolean |
deleteElt()
Delete the object currently pointed at by the iterator. |
boolean |
deleteEltAt(int index)
Delete the Vertex that has the given index. |
boolean |
deleteVertex()
Delete the current vertex. |
boolean |
deleteVertexAt(int index)
Delete the Vertex that has the given index |
Vertex |
getVertex()
Get the Vertex at which the Iterator currently points. |
Vertex |
getVertexAt(int index)
Get the Vertex that has the given index. |
Methods inherited from class byucc.jhdl.synth.graph.VectorIterator |
first, getElt, getEltAt, isValid, last, moveTo, moveTo, next, prev, size, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface byucc.jhdl.synth.graph.IndexedIterator |
getEltAt, moveTo, size |
Methods inherited from interface byucc.jhdl.synth.graph.GenericIterator |
first, getElt, isValid, last, moveTo, next, prev |
Constructor Detail |
public VertexVectorIterator(VertexVector vertices)
Method Detail |
public Vertex getVertex()
getVertex
in interface VertexIterator
public Vertex getVertexAt(int index)
getVertexAt
in interface IndexedVertexIterator
index
- an index in the range of 0 <= index < size()
public boolean deleteElt()
After calling delete, this iterator's current "pointer" will be at an undefined position, (it may even be invalid). However, calling next() will move it to the element originally after the deleted element and calling prev() will move it to the element originally before element.
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.
deleteElt
in interface GenericIterator
deleteElt
in class VectorIterator
public boolean deleteEltAt(int index)
After calling delete, this iterator's current "pointer" will not be moved. That is, if the object being deleted is not the "current" object then the pointer will still be pointing to the same element it was before the delete. If, however, the current object is deleted then the pointer will be at an undefined position, (it may even be invalid) -- however, calling next() will move it to the element originally after the deleted element and calling prev() will move it to the element originally before element.
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 IndexedIterator
deleteEltAt
in class VectorIterator
index
- the index of an element in the series to delete,
index should be in the range 0 <= index < size()
public boolean deleteVertex()
This method is the same as deleteElt. I'm including it here to maintain naming consistencies. (ie. getElt & getVertex, deleteElt, & deleteVertex etc.)
deleteVertex
in interface VertexIterator
deleteElt
public boolean deleteVertexAt(int index)
This methid is the same as deleteEltAt. I'm including it here to maintain naming consistencies. (ie. getElt & getVertex, deleteElt, & deleteVertex etc.)
deleteVertexAt
in interface IndexedVertexIterator
index
- the index of the Vertex to delete
index should be in the range 0 <= index < size()
deleteEltAt
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |