|
Plexus v0.13.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phoenixst.plexus.AbstractGraph
com.phoenixst.plexus.operations.Product
public class Product
A Graph
which is the product of two other
Graphs
. The nodes are OrderedPair
objects
with exactly two elements, the first element being a node from the
first graph and the second being a node from the second graph.
If either wrapped Graph
contains
Graph.Edges
which point to other
Graph.Edges
, the product will not
reflect this. The node and edge aspects of any such
Graph.Edge
will be distinct in the product.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph |
---|
Graph.Edge |
Constructor Summary | |
---|---|
Product(Graph left,
Graph right)
Creates a new Product graph. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.phoenixst.plexus.AbstractGraph |
---|
addEdge, addNode, adjacentNodes, degree, edges, getAdjacentNode, getEdge, getIncidentEdge, getNode, incidentEdges, nodes, traverser |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Product(Graph left, Graph right)
Product
graph.
left
- the first (left) graph operand for the product
operation.right
- the second (right) graph operand for the product
operation.Method Detail |
---|
public Graph getLeftOperand()
public Graph getRightOperand()
protected Collection nodes()
AbstractGraph
Collection
view of all the nodes
in this Graph
. This method is only called
by nodes( Predicate )
.
nodes
in class AbstractGraph
protected Collection edges()
AbstractGraph
Collection
view of all the
Graph.Edges
in this Graph
.
This method is only called by edges( Predicate )
.
edges
in class AbstractGraph
protected Traverser traverser(Object node)
AbstractGraph
Traverser
over those
Graph.Edges
incident to the specified node.
This method is only called by traverser( node, Predicate )
.
traverser
in class AbstractGraph
public boolean removeNode(Object node)
UnsupportedOperationException
.
removeNode
in interface Graph
removeNode
in class AbstractGraph
node
- the node to be removed from this
Graph
.
true
if this Graph
contained
node
.public boolean containsNode(Object node)
true
if this Graph
contains
node
.
containsNode
in interface Graph
containsNode
in class AbstractGraph
node
- the node whose presence in this Graph
is to be tested.
true
if this Graph
contains
the specified node.public boolean removeEdge(Graph.Edge edge)
UnsupportedOperationException
.
removeEdge
in interface Graph
removeEdge
in class AbstractGraph
edge
- the Graph.Edge
to be removed from
this Graph
.
true
if this Graph
contained
the specified Graph.Edge
.public boolean containsEdge(Graph.Edge edge)
AbstractGraph
edge
,
looking for it and returning true
if found.
containsEdge
in interface Graph
containsEdge
in class AbstractGraph
edge
- the Graph.Edge
whose presence in this
Graph
is to be tested.
true
if this Graph
contains
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 Graph
degree
in class AbstractGraph
node
- return the degree of this node.
node
.public String toString()
toString
in class Object
|
Plexus v0.13.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |