de.cau.cs.kieler.klay.layered.p3order
Class NodeGroup

java.lang.Object
  extended by de.cau.cs.kieler.klay.layered.p3order.NodeGroup
All Implemented Interfaces:
Comparable<NodeGroup>

public class NodeGroup
extends Object
implements Comparable<NodeGroup>

A NodeGroup contains one or more nodes. NodeGroups are used to model sets of nodes that are placed next to each other. They are also used to model a compound node enveloping all child nodes. A NodeGroup contains methods to calculate its barycenter value, to merge with another vertex and to generally do cool stuff.

Rating red

Constructor Summary
NodeGroup(LNode node, Random graphRandom)
          Constructs a new instance containing the given node.
NodeGroup(NodeGroup nodeGroup1, NodeGroup nodeGroup2, Random graphRandom)
          Constructs a new vertex that is the concatenation of the given two vertices.
 
Method Summary
 int compareTo(NodeGroup other)
          Compares this with another Object.
 float getBarycenter()
          Gets the barycenter value of the NodeGroup.
 int getDegree()
          Gets the degree of the NodeGroup.
 int getIncomingConstraintsCount()
          Gets the incomingConstraintsCount of the NodeGroup.
 List<LNode> getNodes()
          Gets the nodes-list.
 List<NodeGroup> getOutgoingConstraints()
          Gets the list of outgoing constraints.
 float getSummedWeight()
          Gets the summedWeight of the NodeGroup.
 void setBarycenter(float value)
          Sets barycenter to the given value.
 void setDegree(int value)
          Sets the degree of the NodeGroup to the given value.
 void setIncomingConstraintsCount(int value)
          Sets the incomingConstraintsCount to the given value.
 void setSummedWeight(float value)
          Sets the summedWeight to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeGroup

public NodeGroup(LNode node,
                 Random graphRandom)
Constructs a new instance containing the given node.

Parameters:
node - the node the vertex should contain.
graphRandom - The random number generator of the graph to be laid out.

NodeGroup

public NodeGroup(NodeGroup nodeGroup1,
                 NodeGroup nodeGroup2,
                 Random graphRandom)
Constructs a new vertex that is the concatenation of the given two vertices. The incoming constraints count is set to zero, while the list of successors are merged, updating the successors' incoming count appropriately if both vertices are predecessors.

Parameters:
nodeGroup1 - the first vertex.
nodeGroup2 - the second vertex.
graphRandom - The random number generator of the graph to be laid out.
Method Detail

getIncomingConstraintsCount

public int getIncomingConstraintsCount()
Gets the incomingConstraintsCount of the NodeGroup.

Returns:
Returns the incomingConstraintsCount.

setIncomingConstraintsCount

public void setIncomingConstraintsCount(int value)
Sets the incomingConstraintsCount to the given value.

Parameters:
value - The value the incomingConstraintsCount is set to.

getOutgoingConstraints

public List<NodeGroup> getOutgoingConstraints()
Gets the list of outgoing constraints.

Returns:
Returns the outgoingConstraints-list of the NodeGroup.

getNodes

public List<LNode> getNodes()
Gets the nodes-list.

Returns:
Returns the nodes-list of the NodeGroup.

getBarycenter

public float getBarycenter()
Gets the barycenter value of the NodeGroup.

Returns:
Returns the barycenter value of the NodeGroup.

setBarycenter

public void setBarycenter(float value)
Sets barycenter to the given value.

Parameters:
value - value the barycenter is to be set to.

getSummedWeight

public float getSummedWeight()
Gets the summedWeight of the NodeGroup.

Returns:
Returns the summedWeight of the NodeGroup.

setSummedWeight

public void setSummedWeight(float value)
Sets the summedWeight to the given value.

Parameters:
value - The value summedWeight is to be set to.

getDegree

public int getDegree()
Gets the degree of the NodeGroup.

Returns:
Returns the degree of the NodeGroup.

setDegree

public void setDegree(int value)
Sets the degree of the NodeGroup to the given value.

Parameters:
value - The value the degree is to be set to.

compareTo

public int compareTo(NodeGroup other)
Compares this with another Object. Returns -1 if this object is smaller, 0 if both objects are equal and 1 if this object is bigger.

Specified by:
compareTo in interface Comparable<NodeGroup>
Parameters:
other - the object to compare with
Returns:
one of the values -1, 0, 1