Interface IndexedVertexIterator

All Superinterfaces:
GenericIterator, IndexedIterator, VertexIterator
All Known Implementing Classes:

public interface IndexedVertexIterator
extends IndexedIterator, VertexIterator

IndexedVertexIterator is an interface that has all the functionality of IndexedIterator as well as VertexIterator. It also adds the methods getVertexAt and deleteVertexAt.

Carl Worth

Method Summary
 boolean deleteVertexAt(int index)
          Delete the Vertex that has the given index from this iterator and from the graph.
 Vertex getVertexAt(int index)
          Retrieves the Vertex at the given index.
Methods inherited from interface byucc.jhdl.synth.graph.IndexedIterator
deleteEltAt, getEltAt, moveTo, size
Methods inherited from interface byucc.jhdl.synth.graph.GenericIterator
deleteElt, first, getElt, isValid, last, moveTo, next, prev
Methods inherited from interface byucc.jhdl.synth.graph.VertexIterator
deleteVertex, getVertex

Method Detail


public Vertex getVertexAt(int index)
Retrieves the Vertex at the given index. (The current pointer will not be moved.) This can be implemented as a wrapper around getEltAt that simply provides a class cast to Vertex.

index - an index in the range of 0 <= index < size()
the object in the series with the given index, null if index is out of bounds.


public boolean deleteVertexAt(int index)
Delete the Vertex that has the given index from this iterator and from the graph.

This method must delete the Vertex at index from its graph as well as from this iterator. (deleteEltAt must delete the vertex from the iterator but may or may not delete it from the graph depending on the implementation. The behavior should be documented in the implementing class.)

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.

index - the index of an element in the series to delete, index should be in the range 0 <= index < size()
true if the object was deleted false if the index is out of bounds

Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.