java.lang.Object
org.objectstyle.ashwood.graph.MapDigraph
- All Implemented Interfaces:
- Digraph, DigraphIteration, java.io.Serializable
- public class MapDigraph
- extends java.lang.Object
- implements Digraph, java.io.Serializable
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HASHMAP_FACTORY
public static final org.apache.commons.collections.Factory HASHMAP_FACTORY
TREEMAP_FACTORY
public static final org.apache.commons.collections.Factory TREEMAP_FACTORY
mapFactory
private org.apache.commons.collections.Factory mapFactory
graph
private java.util.Map graph
size
private int size
MapDigraph
public MapDigraph()
MapDigraph
public MapDigraph(org.apache.commons.collections.Factory mapFactory)
addVertex
public boolean addVertex(java.lang.Object vertex)
- Specified by:
addVertex in interface Digraph
addAllVertices
public boolean addAllVertices(java.util.Collection vertices)
- Specified by:
addAllVertices in interface Digraph
putArc
public java.lang.Object putArc(java.lang.Object origin,
java.lang.Object destination,
java.lang.Object arc)
- Specified by:
putArc in interface Digraph
getArc
public java.lang.Object getArc(java.lang.Object origin,
java.lang.Object destination)
- Specified by:
getArc in interface Digraph
removeVertex
public boolean removeVertex(java.lang.Object vertex)
- Specified by:
removeVertex in interface Digraph
removeAllVertices
public boolean removeAllVertices(java.util.Collection vertices)
- Specified by:
removeAllVertices in interface Digraph
removeArc
public java.lang.Object removeArc(java.lang.Object origin,
java.lang.Object destination)
- Specified by:
removeArc in interface Digraph
removeIncoming
public boolean removeIncoming(java.lang.Object vertex)
- Specified by:
removeIncoming in interface Digraph
removeOutgoing
public boolean removeOutgoing(java.lang.Object vertex)
- Specified by:
removeOutgoing in interface Digraph
vertexIterator
public java.util.Iterator vertexIterator()
- Specified by:
vertexIterator in interface DigraphIteration
arcIterator
public ArcIterator arcIterator()
- Specified by:
arcIterator in interface DigraphIteration
outgoingIterator
public ArcIterator outgoingIterator(java.lang.Object vertex)
- Specified by:
outgoingIterator in interface DigraphIteration
incomingIterator
public ArcIterator incomingIterator(java.lang.Object vertex)
- Specified by:
incomingIterator in interface DigraphIteration
order
public int order()
- Specified by:
order in interface Digraph
size
public int size()
- Specified by:
size in interface Digraph
outgoingSize
public int outgoingSize(java.lang.Object vertex)
- Specified by:
outgoingSize in interface Digraph
incomingSize
public int incomingSize(java.lang.Object vertex)
- Specified by:
incomingSize in interface Digraph
containsVertex
public boolean containsVertex(java.lang.Object vertex)
- Specified by:
containsVertex in interface Digraph
containsAllVertices
public boolean containsAllVertices(java.util.Collection vertices)
- Specified by:
containsAllVertices in interface Digraph
hasArc
public boolean hasArc(java.lang.Object origin,
java.lang.Object destination)
- Specified by:
hasArc in interface Digraph
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Digraph
isOutgoingEmpty
public boolean isOutgoingEmpty(java.lang.Object vertex)
- Specified by:
isOutgoingEmpty in interface Digraph
isIncomingEmpty
public boolean isIncomingEmpty(java.lang.Object vertex)
- Specified by:
isIncomingEmpty in interface Digraph
createMap
private java.util.Map createMap()