byucc.jhdl.synth.graph
Interface IndexedVertexIterator

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

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.

Author:
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

getVertexAt

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.

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

deleteVertexAt

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.

Parameters:
index - the index of an element in the series to delete, index should be in the range 0 <= index < size()
Returns:
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.