Plexus v0.13.1

com.phoenixst.plexus.examples
Class CirculantGraph

java.lang.Object
  extended by com.phoenixst.plexus.AbstractGraph
      extended by com.phoenixst.plexus.examples.AbstractIntegerNodeGraph
          extended by com.phoenixst.plexus.examples.CirculantGraph
All Implemented Interfaces:
Graph, Serializable

public class CirculantGraph
extends AbstractIntegerNodeGraph

A circulant Graph. If the nodes are arranged in a circle, then each node is adjacent to a fixed number of nodes in either direction.

Since:
1.0
Version:
$Revision: 1.13 $
Author:
Ray A. Conner
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.phoenixst.plexus.examples.AbstractIntegerNodeGraph
AbstractIntegerNodeGraph.AbstractIntegerEdgeCollection, AbstractIntegerNodeGraph.EdgeImpl
 
Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph
Graph.Edge
 
Constructor Summary
CirculantGraph(int n, int d)
          Creates a new CirculantGraph.
 
Method Summary
protected  Graph.Edge createEdge(int tailIndex, int headIndex)
          If an edge exists between the specified indices, create and return it.
protected  Collection createEdgeCollection()
          Creates the (single) collection of edges for this instance.
protected  Traverser createTraverser(int nodeIndex)
          Creates a traverser with no filtering; assumes that the node index is valid.
 int degree(Object node)
          Returns the degree of node, defined as the number of edges incident on node.
 String toString()
           
 
Methods inherited from class com.phoenixst.plexus.examples.AbstractIntegerNodeGraph
checkNode, containsEdge, containsNode, edges, getNodeIndex, getNodeSize, nodes, removeEdge, removeNode, traverser
 
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

CirculantGraph

public CirculantGraph(int n,
                      int d)
Creates a new CirculantGraph.

Parameters:
n - the number of nodes in the new CirculantGraph.
d - each node is adjacent to this many of the nearest nodes in either direction.
Method Detail

degree

public int degree(Object node)
Returns the degree of node, defined as the number of edges incident on node.

Specified by:
degree in interface Graph
Overrides:
degree in class AbstractGraph
Parameters:
node - return the degree of this node.
Returns:
the degree of node.

createEdge

protected Graph.Edge createEdge(int tailIndex,
                                int headIndex)
Description copied from class: AbstractIntegerNodeGraph
If an edge exists between the specified indices, create and return it. If not, return null. The indices are assumed to represent valid nodes for this Graph.

Specified by:
createEdge in class AbstractIntegerNodeGraph

createEdgeCollection

protected Collection createEdgeCollection()
Description copied from class: AbstractIntegerNodeGraph
Creates the (single) collection of edges for this instance.

Specified by:
createEdgeCollection in class AbstractIntegerNodeGraph

createTraverser

protected Traverser createTraverser(int nodeIndex)
Description copied from class: AbstractIntegerNodeGraph
Creates a traverser with no filtering; assumes that the node index is valid.

Specified by:
createTraverser in class AbstractIntegerNodeGraph

toString

public String toString()
Overrides:
toString in class Object

Plexus v0.13.1

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.