public class Join extends AbstractGraph implements Serializable
Graph which is the join of two other
Graphs with disjoint node sets. This implementation
does not actually check that the node sets are disjoint, but will
definitely behave strangely if they are not. The new edges added
to the the union of the two graphs may be directed or undirected as
specified in the constructor. These new edges never contain
user-defined objects.Graph.Edge| Constructor and Description |
|---|
Join(Graph left,
Graph right,
boolean isDirected)
Creates a new
Join graph. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsEdge(Graph.Edge edge)
This implementation traverses over the edges in this graph
incident on the tail of the specified
edge,
looking for it and returning true if found. |
boolean |
containsNode(Object node)
Returns
true if this Graph contains
node. |
int |
degree(Object node)
Returns the degree of
node, defined as the number
of edges incident on node, with self-loops
counted twice. |
protected Collection |
edges()
Returns a
Collection view of all the
Graph.Edges in this Graph. |
Graph |
getLeftOperand() |
Graph |
getRightOperand() |
protected Collection |
nodes()
Returns a
Collection view of all the nodes
in this Graph. |
boolean |
removeEdge(Graph.Edge edge)
Throws an
UnsupportedOperationException. |
boolean |
removeNode(Object node)
Throws an
UnsupportedOperationException. |
String |
toString() |
protected Traverser |
traverser(Object node)
Returns an unfiltered
Traverser over those
Graph.Edges incident to the specified node. |
addEdge, addNode, adjacentNodes, degree, edges, getAdjacentNode, getEdge, getIncidentEdge, getNode, incidentEdges, nodes, traverserpublic Join(Graph left, Graph right, boolean isDirected)
Join graph.left - the first (left) graph operand for the join
operation.right - the second (right) graph operand for the join
operation.isDirected - whether or not the new edges added as part
of the join operation are directed. If true,
nodes from the first operand are the tails of the edges.public Graph getLeftOperand()
public Graph getRightOperand()
protected Collection nodes()
AbstractGraphCollection view of all the nodes
in this Graph. This method is only called
by nodes( Predicate ).nodes in class AbstractGraphprotected Collection edges()
AbstractGraphCollection view of all the
Graph.Edges in this Graph.
This method is only called by edges( Predicate ).edges in class AbstractGraphprotected Traverser traverser(Object node)
AbstractGraphTraverser over those
Graph.Edges incident to the specified node.
This method is only called by traverser( node, Predicate ).traverser in class AbstractGraphpublic boolean containsNode(Object node)
true if this Graph contains
node.containsNode in interface GraphcontainsNode in class AbstractGraphnode - the node whose presence in this Graph
is to be tested.true if this Graph contains
the specified node.public boolean removeNode(Object node)
UnsupportedOperationException.removeNode in interface GraphremoveNode in class AbstractGraphnode - the node to be removed from this
Graph.true if this Graph contained
node.public boolean containsEdge(Graph.Edge edge)
edge,
looking for it and returning true if found.containsEdge in interface GraphcontainsEdge in class AbstractGraphedge - the Graph.Edge whose presence in this
Graph is to be tested.true if this Graph contains
the specified Graph.Edge.public boolean removeEdge(Graph.Edge edge)
UnsupportedOperationException.removeEdge in interface GraphremoveEdge in class AbstractGraphedge - the Graph.Edge to be removed from
this Graph.true if this Graph contained
the specified Graph.Edge.public int degree(Object node)
node, defined as the number
of edges incident on node, with self-loops
counted twice.degree in interface Graphdegree in class AbstractGraphnode - return the degree of this node.node.See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.