|
|||||||||
| Home >> All >> com >> phoenixst >> [ plexus overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.phoenixst.plexus
Class GraphUtils.SynchronizedGraphWrapper

java.lang.Objectcom.phoenixst.plexus.GraphWrapper
com.phoenixst.plexus.GraphUtils.SynchronizedGraphWrapper
- All Implemented Interfaces:
- Graph, java.io.Serializable
- Direct Known Subclasses:
- GraphUtils.SynchronizedObservableGraphWrapper
- Enclosing class:
- GraphUtils
- private static class GraphUtils.SynchronizedGraphWrapper
- extends GraphWrapper
| Nested Class Summary | |
private class |
GraphUtils.SynchronizedGraphWrapper.SynchronizedEdgeWrapper
|
private class |
GraphUtils.SynchronizedGraphWrapper.SynchronizedIteratorWrapper
|
private class |
GraphUtils.SynchronizedGraphWrapper.SynchronizedTraverserWrapper
|
| Nested classes inherited from class com.phoenixst.plexus.GraphWrapper |
GraphWrapper.EdgeIteratorWrapper, GraphWrapper.EdgeWrapper, GraphWrapper.NodeIteratorWrapper, GraphWrapper.TraverserWrapper |
| Nested classes inherited from class com.phoenixst.plexus.Graph |
Graph.Edge |
| Field Summary | |
protected java.lang.Object |
mutex
|
| Fields inherited from class com.phoenixst.plexus.GraphWrapper |
g |
| Constructor Summary | |
private |
GraphUtils.SynchronizedGraphWrapper(Graph g)
|
private |
GraphUtils.SynchronizedGraphWrapper(Graph g,
java.lang.Object mutex)
|
| Method Summary | |
Graph.Edge |
addEdge(java.lang.Object object,
java.lang.Object tail,
java.lang.Object head)
Adds the specified edge to the Graph (optional
operation). |
boolean |
addNode(java.lang.Object node)
Adds node to this Graph (optional
operation). |
void |
clear()
Removes all nodes and edges from this Graph
(optional operation). |
boolean |
containsEdge(Graph.Edge edge)
Returns true if this Graph contains
the specified Edge. |
boolean |
containsNode(java.lang.Object node)
Returns true if this Graph contains
the specified node. |
int |
degree(java.lang.Object node)
Returns the degree of node, defined as the number
of edges incident on node, with self-loops
counted twice. |
java.util.Iterator |
edgeIterator()
Returns an Iterator over all the
Edges in this Graph. |
java.util.Iterator |
edgeIterator(java.lang.Object tail,
java.lang.Object head)
Returns an Iterator over all Edges
from this Graph with the specified tail and head. |
int |
edgeSize()
Returns the number of edges in this Graph. |
Graph.Edge |
getEdge(java.lang.Object tail,
java.lang.Object head)
Returns an Edge from this Graph with
the specified tail and head, or null if it does
not exist. |
int |
inDegree(java.lang.Object node)
If this is a directed graph, returns the in degree of node, defined as the number of edges entering
node. |
Traverser |
inTraverser(java.lang.Object node)
If this is a directed graph, returns a Traverser
from node to all adjacent nodes reachable through
edges whose head is the given node. |
boolean |
isDirected()
Returns whether or not this Graph is directed. |
boolean |
isEmpty()
Returns true if this Graph contains
no edges, it may contain nodes. |
boolean |
isSimple()
Returns whether or not this Graph is simple. |
java.util.Iterator |
nodeIterator()
Returns an Iterator over all the nodes in this
Graph. |
int |
nodeSize()
Returns the number of nodes in this Graph. |
int |
outDegree(java.lang.Object node)
If this is a directed graph, returns the out degree of node, defined as the number of edges leaving
node. |
Traverser |
outTraverser(java.lang.Object node)
If this is a directed graph, returns a Traverser
from node to all adjacent nodes reachable through
edges whose tail is the given node. |
boolean |
removeEdge(Graph.Edge edge)
Removes the specified Edge from this
Graph (optional operation). |
boolean |
removeNode(java.lang.Object node)
Removes node from this Graph
(optional operation). |
Traverser |
traverser(java.lang.Object node)
Returns a Traverser from node to all
adjacent nodes. |
protected GraphWrapper.EdgeWrapper |
wrapEdge(Graph.Edge edge)
Returns a wrapped Edge. |
protected java.util.Iterator |
wrapEdgeIterator(java.util.Iterator edgeIter)
Returns a wrapped edge iterator. |
protected java.util.Iterator |
wrapNodeIterator(java.util.Iterator nodeIter)
Returns a wrapped node iterator. |
protected Traverser |
wrapTraverser(Traverser traverser)
Returns a wrapped traverser. |
| Methods inherited from class com.phoenixst.plexus.GraphWrapper |
unwrapEdge, unwrapEdgeObject, unwrapNode, wrapEdgeObject, wrapNode |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
mutex
protected java.lang.Object mutex
| Constructor Detail |
GraphUtils.SynchronizedGraphWrapper
private GraphUtils.SynchronizedGraphWrapper(Graph g)
GraphUtils.SynchronizedGraphWrapper
private GraphUtils.SynchronizedGraphWrapper(Graph g, java.lang.Object mutex)
| Method Detail |
wrapEdge
protected GraphWrapper.EdgeWrapper wrapEdge(Graph.Edge edge)
- Description copied from class:
GraphWrapper - Returns a wrapped Edge.
- Overrides:
wrapEdgein classGraphWrapper
wrapNodeIterator
protected java.util.Iterator wrapNodeIterator(java.util.Iterator nodeIter)
- Description copied from class:
GraphWrapper - Returns a wrapped node iterator.
- Overrides:
wrapNodeIteratorin classGraphWrapper
wrapEdgeIterator
protected java.util.Iterator wrapEdgeIterator(java.util.Iterator edgeIter)
- Description copied from class:
GraphWrapper - Returns a wrapped edge iterator.
- Overrides:
wrapEdgeIteratorin classGraphWrapper
wrapTraverser
protected Traverser wrapTraverser(Traverser traverser)
- Description copied from class:
GraphWrapper - Returns a wrapped traverser.
- Overrides:
wrapTraverserin classGraphWrapper
isDirected
public boolean isDirected()
- Description copied from interface:
Graph - Returns whether or not this
Graphis directed.- Specified by:
isDirectedin interfaceGraph- Overrides:
isDirectedin classGraphWrapper
isSimple
public boolean isSimple()
- Description copied from interface:
Graph - Returns whether or not this
Graphis simple.- Specified by:
isSimplein interfaceGraph- Overrides:
isSimplein classGraphWrapper
isEmpty
public boolean isEmpty()
- Description copied from interface:
Graph - Returns
trueif thisGraphcontains no edges, it may contain nodes.- Specified by:
isEmptyin interfaceGraph- Overrides:
isEmptyin classGraphWrapper
nodeSize
public int nodeSize()
- Description copied from interface:
Graph - Returns the number of nodes in this
Graph. If thisGraphcontains more thanInteger.MAX_VALUEnodes, returnsInteger.MAX_VALUE.- Specified by:
nodeSizein interfaceGraph- Overrides:
nodeSizein classGraphWrapper
edgeSize
public int edgeSize()
- Description copied from interface:
Graph - Returns the number of edges in this
Graph. If thisGraphcontains more thanInteger.MAX_VALUEedges, returnsInteger.MAX_VALUE.- Specified by:
edgeSizein interfaceGraph- Overrides:
edgeSizein classGraphWrapper
degree
public int degree(java.lang.Object node)
- Description copied from interface:
Graph - Returns the degree of
node, defined as the number of edges incident onnode, with self-loops counted twice. If this node has more thanInteger.MAX_VALUEincident edges, returnsInteger.MAX_VALUE.- Specified by:
degreein interfaceGraph- Overrides:
degreein classGraphWrapper
outDegree
public int outDegree(java.lang.Object node)
- Description copied from interface:
Graph - If this is a directed graph, returns the out degree of
node, defined as the number of edges leavingnode. If this is not a directed graph, throwsUnsupportedOperationException. If this node has more thanInteger.MAX_VALUEedges leaving it, returnsInteger.MAX_VALUE.- Specified by:
outDegreein interfaceGraph- Overrides:
outDegreein classGraphWrapper
inDegree
public int inDegree(java.lang.Object node)
- Description copied from interface:
Graph - If this is a directed graph, returns the in degree of
node, defined as the number of edges enteringnode. If this is not a directed graph, throwsUnsupportedOperationException. If this node has more thanInteger.MAX_VALUEedges entering it, returnsInteger.MAX_VALUE.- Specified by:
inDegreein interfaceGraph- Overrides:
inDegreein classGraphWrapper
addNode
public boolean addNode(java.lang.Object node)
- Description copied from interface:
Graph - Adds
nodeto thisGraph(optional operation). Returnstrueif thisGraphchanged as a result of the call. Returnsfalseif thisGraphalready containsnode.If a
Graphrefuses to add a particular node for any reason other than that it already contains the node, it must throw an exception (rather than returningfalse). This preserves the invariant that aGraphalways contains the specified node after this call returns.Graphclasses should clearly specify in their documentation any other restrictions on what nodes may be added.- Specified by:
addNodein interfaceGraph- Overrides:
addNodein classGraphWrapper
removeNode
public boolean removeNode(java.lang.Object node)
- Description copied from interface:
Graph - Removes
nodefrom thisGraph(optional operation). This method will also remove all edges incident uponnode.- Specified by:
removeNodein interfaceGraph- Overrides:
removeNodein classGraphWrapper
containsNode
public boolean containsNode(java.lang.Object node)
- Description copied from interface:
Graph - Returns
trueif thisGraphcontains the specified node.- Specified by:
containsNodein interfaceGraph- Overrides:
containsNodein classGraphWrapper
addEdge
public Graph.Edge addEdge(java.lang.Object object, java.lang.Object tail, java.lang.Object head)
- Description copied from interface:
Graph - Adds the specified edge to the
Graph(optional operation). Returns the newly createdEdgeif thisGraphchanged as a result of the call. Returnsnullif thisGraphdoes not allow duplicate edges and already contains the specified edge.If a
Graphrefuses to add a particular edge for any reason other than that it already contains the edge, it must throw an exception (rather than returningnull). This preserves the invariant that aGraphalways contains the specified edge after this call returns.Graphclasses should clearly specify in their documentation any other restrictions on what edges may be added.- Specified by:
addEdgein interfaceGraph- Overrides:
addEdgein classGraphWrapper
removeEdge
public boolean removeEdge(Graph.Edge edge)
- Description copied from interface:
Graph - Removes the specified
Edgefrom thisGraph(optional operation).- Specified by:
removeEdgein interfaceGraph- Overrides:
removeEdgein classGraphWrapper
containsEdge
public boolean containsEdge(Graph.Edge edge)
- Description copied from interface:
Graph - Returns
trueif thisGraphcontains the specifiedEdge.- Specified by:
containsEdgein interfaceGraph- Overrides:
containsEdgein classGraphWrapper
getEdge
public Graph.Edge getEdge(java.lang.Object tail, java.lang.Object head)
- Description copied from interface:
Graph - Returns an
Edgefrom thisGraphwith the specified tail and head, ornullif it does not exist.- Specified by:
getEdgein interfaceGraph- Overrides:
getEdgein classGraphWrapper
clear
public void clear()
- Description copied from interface:
Graph - Removes all nodes and edges from this
Graph(optional operation).- Specified by:
clearin interfaceGraph- Overrides:
clearin classGraphWrapper
nodeIterator
public java.util.Iterator nodeIterator()
- Description copied from interface:
Graph - Returns an
Iteratorover all the nodes in thisGraph. Calling Iterator.remove()>Iterator.remove()55 removes the last node returned by theIterator, and all edges incident upon that node, from thisGraph. There are no guarantees concerning the order in which the nodes are returned (unless thisGraphis an instance of some class that provides a guarantee).- Specified by:
nodeIteratorin interfaceGraph- Overrides:
nodeIteratorin classGraphWrapper
edgeIterator
public java.util.Iterator edgeIterator()
- Description copied from interface:
Graph - Returns an
Iteratorover all theEdgesin thisGraph. There are no guarantees concerning the order in which the edges are returned (unless thisGraphis an instance of some class that provides a guarantee).- Specified by:
edgeIteratorin interfaceGraph- Overrides:
edgeIteratorin classGraphWrapper
edgeIterator
public java.util.Iterator edgeIterator(java.lang.Object tail, java.lang.Object head)
- Description copied from interface:
Graph - Returns an
Iteratorover allEdgesfrom thisGraphwith the specified tail and head.- Specified by:
edgeIteratorin interfaceGraph- Overrides:
edgeIteratorin classGraphWrapper
traverser
public Traverser traverser(java.lang.Object node)
- Description copied from interface:
Graph - Returns a
Traverserfromnodeto all adjacent nodes. If the implementation is a multigraph, the nodes returned by Iterator.next()>Iterator.next()55 are not necessarily distinct. Self-loops are only traversed once. There are no guarantees concerning the order in which the nodes are returned (unless thisGraphis an instance of some class that provides a guarantee).- Specified by:
traverserin interfaceGraph- Overrides:
traverserin classGraphWrapper
outTraverser
public Traverser outTraverser(java.lang.Object node)
- Description copied from interface:
Graph - If this is a directed graph, returns a
Traverserfromnodeto all adjacent nodes reachable through edges whose tail is the given node. If this is not a directed graph, throwsUnsupportedOperationException. If the implementation is a multigraph, the nodes returned by Iterator.next()>Iterator.next()55 are not necessarily distinct. There are no guarantees concerning the order in which the nodes are returned (unless thisGraphis an instance of some class that provides a guarantee).- Specified by:
outTraverserin interfaceGraph- Overrides:
outTraverserin classGraphWrapper
inTraverser
public Traverser inTraverser(java.lang.Object node)
- Description copied from interface:
Graph - If this is a directed graph, returns a
Traverserfromnodeto all adjacent nodes reachable through edges whose head is the given node. If this is not a directed graph, throwsUnsupportedOperationException. If the implementation is a multigraph, the nodes returned by Iterator.next()>Iterator.next()55 are not necessarily distinct. There are no guarantees concerning the order in which the nodes are returned (unless thisGraphis an instance of some class that provides a guarantee).- Specified by:
inTraverserin interfaceGraph- Overrides:
inTraverserin classGraphWrapper
|
|||||||||
| Home >> All >> com >> phoenixst >> [ plexus overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC