com.hedgehog.math.graph_tree
Class UndirectedGraph<NodeType>

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.math.graph_tree.Graph<NodeType>
          extended by com.hedgehog.math.graph_tree.UndirectedGraph<NodeType>
Type Parameters:
NodeType - Node type.
All Implemented Interfaces:
ModelObject, java.lang.Comparable, java.util.Comparator
Direct Known Subclasses:
RegularGraph

public class UndirectedGraph<NodeType>
extends Graph<NodeType>

Title: UndirectedGraph - models an undirected graph of nodes and arcs.

Description: Models a general graph of nodes and arcs.

Copyright: Copyright (c) Hedgehog Software 2007-2009.

Company: Hedgehog Software

Since:
1.0
Version:
1.1

Field Summary
 
Fields inherited from class com.hedgehog.math.graph_tree.Graph
mObjectNodeMap
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
UndirectedGraph()
          Default constructor.
UndirectedGraph(java.util.ArrayList<GraphTreeNode<NodeType>> nodes)
          Constructs a new graph with the specified linked list of nodes.
UndirectedGraph(GraphTreeNode<NodeType> node)
          COnstructor.
UndirectedGraph(java.util.Hashtable<NodeType,GraphTreeNode<NodeType>> nodes)
          Constructor.
UndirectedGraph(UndirectedGraph<NodeType> object)
          Copy constructor.
UndirectedGraph(UndirectedGraphTreeNode<NodeType> node)
          Constructs a new graph, initialising it with the specified node.
 
Method Summary
 
Methods inherited from class com.hedgehog.math.graph_tree.Graph
addNode, addNodeObject, bfsIterator, childModelObjects, clear, databaseInsertStatement, databaseUpdateStatement, dfsIterator, fromDatabase, fromXMLNode, getNode, getNodes, graphNodeIDs, graphNodeType, isEmpty, isNodeInGraph, isNodeObjectInGraph, numberOfNodes, numberOfNodes, randomNode, removeAllNodeAdjacencies, removeAllNodes, removeNode, setNodes, toString, toX3DNode, toXMLNode
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndirectedGraph

public UndirectedGraph()
Default constructor. Sets the linked list of nodes to null.


UndirectedGraph

public UndirectedGraph(GraphTreeNode<NodeType> node)
                throws java.lang.IllegalArgumentException
COnstructor.

Parameters:
node - Node to initialise this graph.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified node is null.

UndirectedGraph

public UndirectedGraph(UndirectedGraphTreeNode<NodeType> node)
Constructs a new graph, initialising it with the specified node.

Parameters:
node - Graph node to initialise graph.
Throws:
java.lang.IllegalArgumentException - Null node argument.

UndirectedGraph

public UndirectedGraph(java.util.Hashtable<NodeType,GraphTreeNode<NodeType>> nodes)
Constructor. Creates a new graph from the specified hash-table of nodes.

Parameters:
nodes - Hash-table of nodes.

UndirectedGraph

public UndirectedGraph(java.util.ArrayList<GraphTreeNode<NodeType>> nodes)
Constructs a new graph with the specified linked list of nodes.

Parameters:
nodes - Vector of nodes.
Throws:
java.lang.IllegalArgumentException - Null nodes argument.

UndirectedGraph

public UndirectedGraph(UndirectedGraph<NodeType> object)
Copy constructor.

Parameters:
object - Object to copy.