com.jeffpalm.internal.graph
Class GraphImpl

java.lang.Object
  extended by com.jeffpalm.internal.graph.GraphImpl
All Implemented Interfaces:
Graph
Direct Known Subclasses:
CallGraph

public class GraphImpl
extends java.lang.Object
implements Graph


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jeffpalm.graph.Graph
Graph.Algorithm, Graph.Transform
 
Constructor Summary
GraphImpl()
           
GraphImpl(Factory factory)
           
 
Method Summary
 Edge addEdge(Node source, Node sink, java.lang.Object keyObject)
           
 Node addNode(java.lang.Object keyObject)
           
 java.util.Collection allEdges()
           
 java.util.Collection allNodes()
           
 boolean clear()
           
 Edge.Iterator edgeIterator()
           
 Edge getEdge(java.lang.Object keyObject)
           
 Factory getFactory()
           
 Node getNode(java.lang.Object keyObject)
           
 Node getRoot()
           
 boolean hasEdge(Edge edge)
           
 boolean hasNode(Node node)
           
 Node.Iterator nodeIterator()
           
 int numEdges()
           
 int numNodes()
           
 Path.Iterator pathIterator(Node from, Node to)
           
 Node setRoot(Node node)
           
 java.lang.String toString()
           
 void unsetRoot()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphImpl

public GraphImpl(Factory factory)

GraphImpl

public GraphImpl()
Method Detail

getFactory

public Factory getFactory()
Specified by:
getFactory in interface Graph

addNode

public final Node addNode(java.lang.Object keyObject)
Specified by:
addNode in interface Graph

addEdge

public final Edge addEdge(Node source,
                          Node sink,
                          java.lang.Object keyObject)
Specified by:
addEdge in interface Graph

allNodes

public final java.util.Collection allNodes()
Specified by:
allNodes in interface Graph

allEdges

public final java.util.Collection allEdges()
Specified by:
allEdges in interface Graph

hasNode

public final boolean hasNode(Node node)
Specified by:
hasNode in interface Graph

hasEdge

public final boolean hasEdge(Edge edge)
Specified by:
hasEdge in interface Graph

getRoot

public final Node getRoot()

unsetRoot

public final void unsetRoot()

numNodes

public final int numNodes()
Specified by:
numNodes in interface Graph

numEdges

public final int numEdges()
Specified by:
numEdges in interface Graph

getNode

public final Node getNode(java.lang.Object keyObject)
Specified by:
getNode in interface Graph

getEdge

public final Edge getEdge(java.lang.Object keyObject)
Specified by:
getEdge in interface Graph

setRoot

public final Node setRoot(Node node)

nodeIterator

public Node.Iterator nodeIterator()
Specified by:
nodeIterator in interface Graph

edgeIterator

public Edge.Iterator edgeIterator()
Specified by:
edgeIterator in interface Graph

pathIterator

public Path.Iterator pathIterator(Node from,
                                  Node to)
Specified by:
pathIterator in interface Graph

clear

public boolean clear()
Specified by:
clear in interface Graph

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object