net.sourceforge.combean.adapters.drasys.graph
Class DRAGraphAsConstructableNumberedGraph

Package class diagram package DRAGraphAsConstructableNumberedGraph
java.lang.Object
  extended by net.sourceforge.combean.adapters.drasys.graph.DRAGraphAsGraph
      extended by net.sourceforge.combean.adapters.drasys.graph.DRAGraphWithAddVertexIAsGraph
          extended by net.sourceforge.combean.adapters.drasys.graph.DRAGraphWithEditIAsGraph
              extended by net.sourceforge.combean.adapters.drasys.graph.DRAGraphAsConstructableNumberedGraph
All Implemented Interfaces:
Graph, AddEdgeGraphProp, AddNodeGraphProp, ConstructableGraphProp, ConstructableIndexedGraphProp, ConstructableNumberedGraphProp, DirectedEdgeNeighborhoodGraphProp, Freezable, GlobalEdgesGraphProp, GlobalIndexedEdgesGraphProp, GlobalIndexedGraphProp, GlobalIndexedNodesGraphProp, GlobalNodesGraphProp, GlobalNumberedEdgesGraphProp, GlobalNumberedGraphProp, GlobalNumberedNodesGraphProp, IncomingEdgeNeighborhoodGraphProp, NeighborhoodGraphProp, OutgoingEdgeNeighborhoodGraphProp

public class DRAGraphAsConstructableNumberedGraph
extends DRAGraphWithEditIAsGraph
implements ConstructableNumberedGraphProp


Field Summary
 
Fields inherited from interface net.sourceforge.combean.interfaces.graph.prop.GlobalIndexedNodesGraphProp
UNDEFINED_NODE
 
Fields inherited from interface net.sourceforge.combean.interfaces.graph.prop.GlobalIndexedEdgesGraphProp
UNDEFINED_EDGE
 
Constructor Summary
DRAGraphAsConstructableNumberedGraph()
          constructor for an empty graph (uses a standard graph implementation from the OR-Objects library)
DRAGraphAsConstructableNumberedGraph(drasys.or.graph.EditI draGraph)
          Constructor for wrapping a given EditI graph
 
Method Summary
protected  Edge addDraEdge(Object fromKey, Object toKey)
          Add an edge, given the keys of the incident nodes
 void ensureEdgeCapacity(int edgeCapacity)
          Reserve storage for given number of edges.
 Edge getEdge(int index)
          Return the edge with a given index
 int getEdgeNumber(Edge e)
          Get the number of a given edge.
protected  Object getNewEdgeKey()
           
protected  Object getNewNodeKey()
           
 Node getNode(int index)
          Returns the node with the given index.
 int getNodeNumber(Node v)
          Get the number of a given node.
 
Methods inherited from class net.sourceforge.combean.adapters.drasys.graph.DRAGraphWithEditIAsGraph
addEdge, getEditI
 
Methods inherited from class net.sourceforge.combean.adapters.drasys.graph.DRAGraphWithAddVertexIAsGraph
addDraVertex, addNode, ensureNodeCapacity, freeze
 
Methods inherited from class net.sourceforge.combean.adapters.drasys.graph.DRAGraphAsGraph
convertToEdge, convertToNode, getAllEdgesIterator, getAllNodesIterator, getDraGraph, getEdgeClass, getEdgeValue, getFirstNode, getIncidentEdges, getIncomingEdges, getNodeClass, getNumEdges, getNumNodes, getOtherNode, getOutgoingEdges, getSecondNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.prop.AddNodeGraphProp
addNode, ensureNodeCapacity
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.prop.AddEdgeGraphProp
addEdge
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.prop.Freezable
freeze
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.prop.GlobalNodesGraphProp
getAllNodesIterator, getNumNodes
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.prop.GlobalEdgesGraphProp
getAllEdgesIterator, getNumEdges
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.Graph
getEdgeClass, getNodeClass
 

Constructor Detail

DRAGraphAsConstructableNumberedGraph

public DRAGraphAsConstructableNumberedGraph()
constructor for an empty graph (uses a standard graph implementation from the OR-Objects library)


DRAGraphAsConstructableNumberedGraph

public DRAGraphAsConstructableNumberedGraph(drasys.or.graph.EditI draGraph)
Constructor for wrapping a given EditI graph

Parameters:
draGraph - the graph to be wrapped (must be empty)
Method Detail

getNode

public Node getNode(int index)
Description copied from interface: GlobalIndexedNodesGraphProp
Returns the node with the given index.

Specified by:
getNode in interface GlobalIndexedNodesGraphProp
Returns:
node with given index

getEdge

public Edge getEdge(int index)
Description copied from interface: GlobalIndexedEdgesGraphProp
Return the edge with a given index

Specified by:
getEdge in interface GlobalIndexedEdgesGraphProp
Returns:
the edges with the given index

ensureEdgeCapacity

public void ensureEdgeCapacity(int edgeCapacity)
Description copied from interface: AddEdgeGraphProp
Reserve storage for given number of edges.

Specified by:
ensureEdgeCapacity in interface AddEdgeGraphProp
Overrides:
ensureEdgeCapacity in class DRAGraphWithEditIAsGraph
Parameters:
edgeCapacity - the number of edges for which memory shall be reserved,

getNodeNumber

public int getNodeNumber(Node v)
Description copied from interface: GlobalNumberedNodesGraphProp
Get the number of a given node.

Specified by:
getNodeNumber in interface GlobalNumberedNodesGraphProp
Parameters:
v - the node for which the number shall be returned.
Returns:
the number of the node in the interval [0 ... number of nodes-1]

getEdgeNumber

public int getEdgeNumber(Edge e)
Description copied from interface: GlobalNumberedEdgesGraphProp
Get the number of a given edge.

Specified by:
getEdgeNumber in interface GlobalNumberedEdgesGraphProp
Parameters:
e - the edge for which the number shall be returned.
Returns:
the number of the edge in the interval [0 ... number of edges-1]

addDraEdge

protected Edge addDraEdge(Object fromKey,
                          Object toKey)
                   throws drasys.or.graph.DuplicateEdgeException,
                          drasys.or.graph.VertexNotFoundException
Description copied from class: DRAGraphWithEditIAsGraph
Add an edge, given the keys of the incident nodes

Overrides:
addDraEdge in class DRAGraphWithEditIAsGraph
Parameters:
fromKey - the key of the source node
toKey - the key of the target node
Returns:
the added edge
Throws:
drasys.or.graph.DuplicateEdgeException
drasys.or.graph.VertexNotFoundException

getNewEdgeKey

protected Object getNewEdgeKey()
Overrides:
getNewEdgeKey in class DRAGraphWithEditIAsGraph
Returns:
a key for a newly added edge

getNewNodeKey

protected Object getNewNodeKey()
Overrides:
getNewNodeKey in class DRAGraphWithAddVertexIAsGraph
Returns:
a key for a newly added node