net.sourceforge.combean.graph.decorators
Class TransposedGraph

Package class diagram package TransposedGraph
java.lang.Object
  extended by net.sourceforge.combean.graph.decorators.AbstractDecoratedGraph
      extended by net.sourceforge.combean.graph.decorators.TransposedGraph
All Implemented Interfaces:
Graph, DirectedEdgeNeighborhoodGraphProp, IncomingEdgeNeighborhoodGraphProp, NeighborhoodGraphProp, NestedGraphProp, OutgoingEdgeNeighborhoodGraphProp

public class TransposedGraph
extends AbstractDecoratedGraph
implements DirectedEdgeNeighborhoodGraphProp, NestedGraphProp

Decorator which turns a graph into the transposed graph, i.e., the graph with the same structure but all edges reversed.


Constructor Summary
TransposedGraph(DirectedEdgeNeighborhoodGraphProp g)
          Constructor param g the graph which shall be transposed
 
Method Summary
 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 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.
 boolean mayNestGraphProp(Class wantedProp)
          Check whether a property may be provided to the user by the nested graph
 
Methods inherited from class net.sourceforge.combean.graph.decorators.AbstractDecoratedGraph
getEdgeClass, getNestedGraph, getNodeClass, isModifiableGraphProp
 
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.Graph
getEdgeClass, getNodeClass
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.prop.NestedGraphProp
getNestedGraph
 

Constructor Detail

TransposedGraph

public TransposedGraph(DirectedEdgeNeighborhoodGraphProp g)
Constructor param g the graph which shall be transposed

Method Detail

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

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

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

mayNestGraphProp

public boolean mayNestGraphProp(Class wantedProp)
Description copied from interface: NestedGraphProp
Check whether a property may be provided to the user by the nested graph

Specified by:
mayNestGraphProp in interface NestedGraphProp
Parameters:
wantedProp - the property which the user wants to use
Returns:
true if the user may access the nested graph for obtaining the wanted property