ix.util
Class AbstractDirectedGraph
java.lang.Object
ix.util.AbstractDirectedGraph
- All Implemented Interfaces:
- DirectedGraph
public abstract class AbstractDirectedGraph
- extends java.lang.Object
- implements DirectedGraph
A utility class that makes it easier to define a DirectedGraph.
Only the getSuccessors(Object)
method must be defined
by a subclass; however, some other methods will throw an
UnsupportedOperationException if the subclass does not redefine
them. Method isBefore(Object a, Object b)
returns
getSuccessors(a).contains(b)
.
Method Summary |
java.util.Collection |
getAllNodes()
|
java.util.Collection |
getRoots()
|
abstract java.util.Collection |
getSuccessors(java.lang.Object node)
|
boolean |
isBefore(java.lang.Object a,
java.lang.Object b)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDirectedGraph
public AbstractDirectedGraph()
getAllNodes
public java.util.Collection getAllNodes()
- Specified by:
getAllNodes
in interface DirectedGraph
getRoots
public java.util.Collection getRoots()
- Specified by:
getRoots
in interface DirectedGraph
getSuccessors
public abstract java.util.Collection getSuccessors(java.lang.Object node)
- Specified by:
getSuccessors
in interface DirectedGraph
isBefore
public boolean isBefore(java.lang.Object a,
java.lang.Object b)
- Specified by:
isBefore
in interface DirectedGraph