de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph
Class KSlimEdge

java.lang.Object
  extended by de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.KSlimGraphElement
      extended by de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.KSlimEdge
All Implemented Interfaces:
Comparable<KSlimGraphElement>

public class KSlimEdge
extends KSlimGraphElement

An edge in the slim graph structure.

Rating proposed yellow
(2009-12-11) msp

Nested Class Summary
static class KSlimEdge.Bend
          Definition of an edge bend for orthogonal drawing.
 
Constructor Summary
KSlimEdge(KSlimGraph graph, KSlimNode thesource, KSlimNode thetarget)
          Creates an edge connecting two existing nodes.
KSlimEdge(KSlimGraph graph, KSlimNode thesource, KSlimNode thetarget, Object theobj)
          Creates an edge connecting two existing nodes, with an object to be contained.
 
Method Summary
 void connectNodes()
          Connects this edge with the source and target.
 void connectNodes(int sourceRank, int targetRank, boolean forwardSelfLoop)
          Connects this edge with the source and target with given ranks.
 void connectNodes(KSlimNode.Side thesourceSide, KSlimNode.Side thetargetSide)
          Connects this edge with the source and target respecting the order of incidence according to the given node sides.
 List<KSlimEdge.Bend> getBends()
          Returns the bends.
 KSlimFace getLeftFace()
          Returns the left face.
 KSlimFace getRightFace()
          Returns the rightFace.
 KSlimNode getSource()
          Returns the source.
 KSlimNode.Side getSourceSide()
          Returns the source side.
 KSlimNode getTarget()
          Returns the target.
 KSlimNode.Side getTargetSide()
          Returns the target side.
 void setLeftFace(KSlimFace theleftFace)
          Sets the leftFace.
 void setRightFace(KSlimFace therightFace)
          Sets the right face.
 void setSource(KSlimNode thesource)
          Sets the source.
 void setSourceSide(KSlimNode.Side thesourceSide)
          Sets the source side.
 void setTarget(KSlimNode thetarget)
          Sets the target.
 void setTargetSide(KSlimNode.Side thetargetSide)
          Sets the target side.
 String toString()
          
 
Methods inherited from class de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.KSlimGraphElement
compareTo, equals, getId, getObject, getRank, hashCode, setId, setObject, setRank
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KSlimEdge

public KSlimEdge(KSlimGraph graph,
                 KSlimNode thesource,
                 KSlimNode thetarget)
Creates an edge connecting two existing nodes.

Parameters:
graph - the graph to which the new edge shall be added
thesource - source node
thetarget - target node

KSlimEdge

public KSlimEdge(KSlimGraph graph,
                 KSlimNode thesource,
                 KSlimNode thetarget,
                 Object theobj)
Creates an edge connecting two existing nodes, with an object to be contained.

Parameters:
graph - the graph to which the new edge shall be added
thesource - source node
thetarget - target node
theobj - object to be contained
Method Detail

connectNodes

public void connectNodes()
Connects this edge with the source and target. New incidence entries are created for the incidence lists of the source and the target.


connectNodes

public void connectNodes(int sourceRank,
                         int targetRank,
                         boolean forwardSelfLoop)
Connects this edge with the source and target with given ranks. New incidence entries are created for the incidence lists of the source and the target.

Parameters:
sourceRank - rank of the edge at source
targetRank - rank of the edge at target
forwardSelfLoop - for self-loops: is the target rank greater than the source rank?

connectNodes

public void connectNodes(KSlimNode.Side thesourceSide,
                         KSlimNode.Side thetargetSide)
Connects this edge with the source and target respecting the order of incidence according to the given node sides.

Parameters:
thesourceSide - port side at the source node
thetargetSide - port side at the target node

toString

public String toString()

Overrides:
toString in class KSlimGraphElement

setSource

public void setSource(KSlimNode thesource)
Sets the source.

Parameters:
thesource - the source to set

getSource

public KSlimNode getSource()
Returns the source.

Returns:
the source

setTarget

public void setTarget(KSlimNode thetarget)
Sets the target.

Parameters:
thetarget - the target to set

getTarget

public KSlimNode getTarget()
Returns the target.

Returns:
the target

setLeftFace

public void setLeftFace(KSlimFace theleftFace)
Sets the leftFace.

Parameters:
theleftFace - the leftFace to set

getLeftFace

public KSlimFace getLeftFace()
Returns the left face.

Returns:
the left face

setRightFace

public void setRightFace(KSlimFace therightFace)
Sets the right face.

Parameters:
therightFace - the right face to set

getRightFace

public KSlimFace getRightFace()
Returns the rightFace.

Returns:
the rightFace

getBends

public List<KSlimEdge.Bend> getBends()
Returns the bends.

Returns:
the bends

setSourceSide

public void setSourceSide(KSlimNode.Side thesourceSide)
Sets the source side.

Parameters:
thesourceSide - the source side to set

getSourceSide

public KSlimNode.Side getSourceSide()
Returns the source side.

Returns:
the source side

setTargetSide

public void setTargetSide(KSlimNode.Side thetargetSide)
Sets the target side.

Parameters:
thetargetSide - the target side to set

getTargetSide

public KSlimNode.Side getTargetSide()
Returns the target side.

Returns:
the target side