de.rwth.graph
Class Graph.NodeDyer

java.lang.Object
  |
  +--de.rwth.graph.Graph.NodeDyer
Enclosing class:
Graph

public class Graph.NodeDyer
extends java.lang.Object

Represents a colouring of this graph's nodes. Nodes added after creation of a Dyer can not be used in the NodeDyer.


Field Summary
protected  java.lang.Object[] colors
          An array with the color for each node in the graph.
 
Constructor Summary
Graph.NodeDyer()
          Creates a new colouring.
 
Method Summary
 java.lang.Object getColor(Graph.Node node)
          Gets the color of a node.
 void setColor(Graph.Node node, java.lang.Object color)
          Sets the colour of a node.
 java.lang.String toString()
          Creates a string representation of this NodeDyer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

colors

protected java.lang.Object[] colors
An array with the color for each node in the graph.
Constructor Detail

Graph.NodeDyer

public Graph.NodeDyer()
Creates a new colouring.
Method Detail

setColor

public void setColor(Graph.Node node,
                     java.lang.Object color)
Sets the colour of a node.
Parameters:
node - The Node which color is to be set.
color - The Object which is the color of this node.
Throws:
java.lang.IllegalArgumentException - if a node of an alien graph is passed as argument.

getColor

public java.lang.Object getColor(Graph.Node node)
Gets the color of a node.
Parameters:
node - The Node which color is wanted.
Returns:
The color of this node or null if setColor was not called for this node.
Throws:
java.lang.IllegalArgumentException - if a node of an alien graph is passed as argument.

toString

public java.lang.String toString()
Creates a string representation of this NodeDyer. It is suited for layouting the graph using dotty. The shape of this nodes is box.
Overrides:
toString in class java.lang.Object
Returns:
dotty compatible String representation