net.sourceforge.combean.adapters.jgraph
Class JGraphModelAsGraph

Package class diagram package JGraphModelAsGraph
java.lang.Object
  extended by net.sourceforge.combean.adapters.jgraph.JGraphModelAsGraph
All Implemented Interfaces:
Graph, DirectedEdgeNeighborhoodGraphProp, GlobalEdgesGraphProp, GlobalIndexedEdgesGraphProp, GlobalIndexedNodesGraphProp, GlobalNodesGraphProp, IncomingEdgeNeighborhoodGraphProp, NeighborhoodGraphProp, OutgoingEdgeNeighborhoodGraphProp

public class JGraphModelAsGraph
extends Object
implements Graph, DirectedEdgeNeighborhoodGraphProp, GlobalIndexedNodesGraphProp, GlobalIndexedEdgesGraphProp

Use a JGraph GraphModel as a Combean Graph


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
JGraphModelAsGraph(org.jgraph.graph.GraphModel jgraph)
          Constructor
 
Method Summary
 EdgeIterator getAllEdgesIterator()
           
 NodeIterator getAllNodesIterator()
          Return an iterator for all nodes in the graph
 Edge getEdge(int index)
          Return the edge with a given index
 Class getEdgeClass()
           
 Node getFirstNode(Edge e)
          Return the first node of an edge.
 EdgeIterator getIncidentEdges(Node v)
          Return an iterator for the local neighborhood of v
 EdgeIterator getIncomingEdges(Node v)
          Get all incoming edges of a given node
 Node getNode(int index)
          Returns the node with the given index.
 Class getNodeClass()
           
 int getNumEdges()
           
 int getNumNodes()
          Return number of nodes in the graph.
 Node getOtherNode(Edge e, Node v)
          Given an edge and an incident node, return the other node of the edge
 EdgeIterator getOutgoingEdges(Node v)
          Get all outgoing edges of a given node
 Node getSecondNode(Edge e)
          Return the second node of an edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGraphModelAsGraph

public JGraphModelAsGraph(org.jgraph.graph.GraphModel jgraph)
Constructor

Parameters:
jgraph - the GraphModel to be wrapped
Method Detail

getNodeClass

public Class getNodeClass()
Specified by:
getNodeClass in interface Graph

getEdgeClass

public Class getEdgeClass()
Specified by:
getEdgeClass in interface Graph

getIncidentEdges

public EdgeIterator getIncidentEdges(Node v)
Description copied from interface: NeighborhoodGraphProp
Return an iterator for the local neighborhood of v

Specified by:
getIncidentEdges in interface NeighborhoodGraphProp
Parameters:
v - the node for which the neighborhood shall be given.
Returns:
an iterator through the neighborhood

getOutgoingEdges

public EdgeIterator getOutgoingEdges(Node v)
Description copied from interface: OutgoingEdgeNeighborhoodGraphProp
Get all outgoing edges of a given node

Specified by:
getOutgoingEdges in interface OutgoingEdgeNeighborhoodGraphProp
Returns:
the incoming edges of v

getIncomingEdges

public EdgeIterator getIncomingEdges(Node v)
Description copied from interface: IncomingEdgeNeighborhoodGraphProp
Get all incoming edges of a given node

Specified by:
getIncomingEdges in interface IncomingEdgeNeighborhoodGraphProp
Returns:
the incoming edges of v

getOtherNode

public Node getOtherNode(Edge e,
                         Node v)
Description copied from interface: NeighborhoodGraphProp
Given an edge and an incident node, return the other node of the edge

Specified by:
getOtherNode in interface NeighborhoodGraphProp
Parameters:
e - the given edge
v - the give node
Returns:
the other incident node of e

getFirstNode

public Node getFirstNode(Edge e)
Description copied from interface: NeighborhoodGraphProp
Return the first node of an edge. For directed graphs this is the source of the edge. For undirected graphs the ordering of the nodes of an edge is arbitrary.

Specified by:
getFirstNode in interface NeighborhoodGraphProp
Parameters:
e - the edge
Returns:
the first node of the given edge

getSecondNode

public Node getSecondNode(Edge e)
Description copied from interface: NeighborhoodGraphProp
Return the second node of an edge. For directed graphs this is the target of the edge. For undirected graphs the ordering of the nodes of an edge is arbitrary.

Specified by:
getSecondNode in interface NeighborhoodGraphProp
Parameters:
e - the edge
Returns:
the second node of the given edge

getAllNodesIterator

public NodeIterator getAllNodesIterator()
Description copied from interface: GlobalNodesGraphProp
Return an iterator for all nodes in the graph

Specified by:
getAllNodesIterator in interface GlobalNodesGraphProp
Returns:
iterator through all nodes

getNumNodes

public int getNumNodes()
Description copied from interface: GlobalNodesGraphProp
Return number of nodes in the graph.

Specified by:
getNumNodes in interface GlobalNodesGraphProp
Returns:
number of nodes

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

getAllEdgesIterator

public EdgeIterator getAllEdgesIterator()
Specified by:
getAllEdgesIterator in interface GlobalEdgesGraphProp
Returns:
an iterator through all edges in the graph

getNumEdges

public int getNumEdges()
Specified by:
getNumEdges in interface GlobalEdgesGraphProp
Returns:
the number of all edges in the graph

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