jcreek.cke.graph
Class DefaultGraph
java.lang.Object
jcreek.cke.graph.DefaultGraph
- All Implemented Interfaces:
- java.lang.Cloneable, Graph, java.io.Serializable
- Direct Known Subclasses:
- TreeGraph
- public class DefaultGraph
- extends java.lang.Object
- implements Graph
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
nodeList
protected java.util.ArrayList nodeList
edgeList
protected java.util.ArrayList edgeList
root
protected Node root
DefaultGraph
public DefaultGraph()
DefaultGraph
public DefaultGraph(VertexList vList,
RelationList rList)
addNode
public boolean addNode(Node node)
- Specified by:
addNode
in interface Graph
addEdge
public boolean addEdge(Edge edge)
- Specified by:
addEdge
in interface Graph
removeNode
public boolean removeNode(Node node)
- Specified by:
removeNode
in interface Graph
removeEdge
public boolean removeEdge(Edge edge)
- Specified by:
removeEdge
in interface Graph
setRoot
public boolean setRoot(Node node)
- Specified by:
setRoot
in interface Graph
isRoot
public boolean isRoot(Node node)
- Specified by:
isRoot
in interface Graph
getRoot
public Node getRoot()
- Specified by:
getRoot
in interface Graph
getNumChildren
public int getNumChildren(Node node)
- Specified by:
getNumChildren
in interface Graph
removeEdges
protected boolean removeEdges(Node child)
edgeSize
public int edgeSize()
- Specified by:
edgeSize
in interface Graph
nodeSize
public int nodeSize()
- Specified by:
nodeSize
in interface Graph
getNodeIterator
public java.util.Iterator getNodeIterator()
- Specified by:
getNodeIterator
in interface Graph
getEdgeIterator
public java.util.Iterator getEdgeIterator(Node node)
- Specified by:
getEdgeIterator
in interface Graph
getEdgeIterator
public java.util.Iterator getEdgeIterator()
- Specified by:
getEdgeIterator
in interface Graph
getChildIterator
public java.util.Iterator getChildIterator(Node node)
- Specified by:
getChildIterator
in interface Graph
copy
public void copy(Graph newGraph)
- Specified by:
copy
in interface Graph
toString
public java.lang.String toString()
Created at IDI, NTNU by the Artificial Intelligence and Learning group