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

java.lang.Objectcom.phoenixst.plexus.AbstractGraph
com.phoenixst.plexus.operations.Product
- All Implemented Interfaces:
- com.phoenixst.plexus.Graph, java.io.Serializable
- public class Product
- extends com.phoenixst.plexus.AbstractGraph
- implements java.io.Serializable
- extends com.phoenixst.plexus.AbstractGraph
A Graph which is the product of two other
Graphs. The nodes are immutable java.util.List 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.
Note: At the present time, only undirected simple graphs
may be used.
If either wrapped Graph contains
Edges which point to other Edges, the
product will not reflect this. The node and edge
aspects of any such Edge will be distinct in the
product.
- Since:
- 1.0
- Version:
- $Revision: 1.14 $
| Nested Class Summary | |
private class |
Product.AllEdgesIteratorImpl
|
private class |
Product.EdgeImpl
An immutable Edge that wraps an edge from one of
the argument graphs, but uses a tail and head from this graph. |
private class |
Product.EdgeIteratorImpl
|
private class |
Product.NodeIterator
|
private static class |
Product.OrderedPair
A simple immutable ordered pair implementation. |
private class |
Product.TraverserImpl
|
| Nested classes inherited from class com.phoenixst.plexus.AbstractGraph |
com.phoenixst.plexus.AbstractGraph.ChainTraverser |
| Nested classes inherited from class com.phoenixst.plexus.Graph |
com.phoenixst.plexus.Graph.Edge |
| Field Summary | |
private com.phoenixst.plexus.Graph |
a
|
private com.phoenixst.plexus.Graph |
b
|
| Constructor Summary | |
Product(com.phoenixst.plexus.Graph a,
com.phoenixst.plexus.Graph b)
Creates a new Product graph. |
|
| Method Summary | |
private java.util.List |
checkNode(java.lang.Object node)
|
private java.util.List |
checkNodeType(java.lang.Object node)
|
void |
clear()
Throws an UnsupportedOperationException. |
boolean |
containsNode(java.lang.Object node)
Returns true if this Graph contains
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 the edges from tail to head. |
int |
edgeSize()
Returns the number of edges in this Graph. |
private static boolean |
equals(java.lang.Object a,
java.lang.Object b)
|
com.phoenixst.plexus.Graph.Edge |
getEdge(java.lang.Object tail,
java.lang.Object head)
Returns the edge from tail to head,
or null if it does not exist. |
com.phoenixst.plexus.Graph |
getLeftOperand()
|
com.phoenixst.plexus.Graph |
getRightOperand()
|
boolean |
isDirected()
Returns false. |
boolean |
isSimple()
Returns true. |
java.util.Iterator |
nodeIterator()
Returns an Iterator over all the nodes in this
Graph. |
int |
nodeSize()
Returns the number of nodes in this Graph. |
boolean |
removeEdge(com.phoenixst.plexus.Graph.Edge edge)
Throws an UnsupportedOperationException. |
boolean |
removeNode(java.lang.Object node)
Throws an UnsupportedOperationException. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
com.phoenixst.plexus.Traverser |
traverser(java.lang.Object node)
Returns a com.phoenixst.plexus.Traverser from node to all
adjacent nodes. |
| Methods inherited from class com.phoenixst.plexus.AbstractGraph |
addEdge, addNode, containsEdge, inDegree, inTraverser, isEmpty, iteratorClear, iteratorContains, iteratorCount, iteratorRemove, outDegree, outTraverser |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
a
private com.phoenixst.plexus.Graph a
b
private com.phoenixst.plexus.Graph b
| Constructor Detail |
Product
public Product(com.phoenixst.plexus.Graph a, com.phoenixst.plexus.Graph b)
- Creates a new
Productgraph.
| Method Detail |
getLeftOperand
public com.phoenixst.plexus.Graph getLeftOperand()
getRightOperand
public com.phoenixst.plexus.Graph getRightOperand()
equals
private static final boolean equals(java.lang.Object a, java.lang.Object b)
checkNodeType
private java.util.List checkNodeType(java.lang.Object node)
checkNode
private java.util.List checkNode(java.lang.Object node)
isDirected
public boolean isDirected()
- Returns
false.- Specified by:
isDirectedin interfacecom.phoenixst.plexus.Graph
isSimple
public boolean isSimple()
- Returns
true.- Specified by:
isSimplein interfacecom.phoenixst.plexus.Graph
nodeSize
public int nodeSize()
- Returns the number of nodes in this
Graph.- Specified by:
nodeSizein interfacecom.phoenixst.plexus.Graph
edgeSize
public int edgeSize()
- Returns the number of edges in this
Graph.- Specified by:
edgeSizein interfacecom.phoenixst.plexus.Graph
degree
public int degree(java.lang.Object node)
- Returns the degree of
node, defined as the number of edges incident onnode, with self-loops counted twice.- Specified by:
degreein interfacecom.phoenixst.plexus.Graph
removeNode
public boolean removeNode(java.lang.Object node)
- Throws an
UnsupportedOperationException.- Specified by:
removeNodein interfacecom.phoenixst.plexus.Graph
containsNode
public boolean containsNode(java.lang.Object node)
- Returns
trueif thisGraphcontainsnode.- Specified by:
containsNodein interfacecom.phoenixst.plexus.Graph
removeEdge
public boolean removeEdge(com.phoenixst.plexus.Graph.Edge edge)
- Throws an
UnsupportedOperationException.- Specified by:
removeEdgein interfacecom.phoenixst.plexus.Graph
getEdge
public com.phoenixst.plexus.Graph.Edge getEdge(java.lang.Object tail, java.lang.Object head)
- Returns the edge from
tailtohead, ornullif it does not exist.- Specified by:
getEdgein interfacecom.phoenixst.plexus.Graph
clear
public void clear()
- Throws an
UnsupportedOperationException.- Specified by:
clearin interfacecom.phoenixst.plexus.Graph
nodeIterator
public java.util.Iterator nodeIterator()
- Description copied from interface:
com.phoenixst.plexus.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 interfacecom.phoenixst.plexus.Graph
edgeIterator
public java.util.Iterator edgeIterator()
- Description copied from interface:
com.phoenixst.plexus.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 interfacecom.phoenixst.plexus.Graph
edgeIterator
public java.util.Iterator edgeIterator(java.lang.Object tail, java.lang.Object head)
- Returns an Iterator over all the edges from
tailtohead.- Specified by:
edgeIteratorin interfacecom.phoenixst.plexus.Graph
traverser
public com.phoenixst.plexus.Traverser traverser(java.lang.Object node)
- Returns a com.phoenixst.plexus.Traverser from
nodeto all adjacent nodes.- Specified by:
traverserin interfacecom.phoenixst.plexus.Graph
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
|
|||||||||
| Home >> All >> com >> phoenixst >> plexus >> [ operations overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC