digraph
Class DiGraph.Vertex<V,E>

java.lang.Object
  extended by digraph.DiGraph.Vertex<V,E>
All Implemented Interfaces:
Graph.Vertex<V,E>, Iterable<Graph.Edge<V,E>>
Enclosing class:
DiGraph<V,E>

public static class DiGraph.Vertex<V,E>
extends Object
implements Graph.Vertex<V,E>

Nested class representing a vertex of a directed graph.


Method Summary
 V getValue()
          Returns the value associated with this vertex.
 boolean isVisited()
          Returns true if this vertex is visited, otherwise false.
 Iterator<Graph.Edge<V,E>> iterator()
          Creates an iterator over the outgoing edges of this vertex.
 void setValue(V value)
          Sets the value associated with this vertex.
 String toString()
          Returns a String representation of the data associated with this vertex.
 void unvisit()
          Marks the vertex as not visited.
 void visit()
          Marks this vertex as visited.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public V getValue()
Returns the value associated with this vertex.

Specified by:
getValue in interface Graph.Vertex<V,E>
Returns:
The value of the data associated with this vertex.

setValue

public void setValue(V value)
Sets the value associated with this vertex.

Specified by:
setValue in interface Graph.Vertex<V,E>
Parameters:
value - The new value of the data associated with this vertex.

unvisit

public void unvisit()
Marks the vertex as not visited.

Specified by:
unvisit in interface Graph.Vertex<V,E>

visit

public void visit()
Marks this vertex as visited.

Specified by:
visit in interface Graph.Vertex<V,E>

isVisited

public boolean isVisited()
Returns true if this vertex is visited, otherwise false.

Specified by:
isVisited in interface Graph.Vertex<V,E>
Returns:
true if this vertex is visted, otherwise false.

iterator

public Iterator<Graph.Edge<V,E>> iterator()
Creates an iterator over the outgoing edges of this vertex.

Specified by:
iterator in interface Iterable<Graph.Edge<V,E>>
Returns:
An iterator of the outgoing edges.

toString

public String toString()
Returns a String representation of the data associated with this vertex.

Overrides:
toString in class Object
Returns:
a String representation of the data associated with this vertex.