uka.karmi.rmi.server
Class ReplicatedServerRef.CollectiveUpdateNode

java.lang.Object
  extended byuka.karmi.rmi.server.ReplicatedServerRef.CollectiveUpdateNode
All Implemented Interfaces:
uka.graph.GraphNode
Enclosing class:
ReplicatedServerRef

class ReplicatedServerRef.CollectiveUpdateNode
extends java.lang.Object
implements uka.graph.GraphNode

Implementation of the GraphNode interface. There is a one-to-one relationship of a ReplicatedServerRef object and an instance of this class.

See Also:
ReplicatedServerRef.node

Field Summary
(package private)  EnlargingIntArray colors
           
(package private)  int degree
           
(package private)  int size
           
 
Fields inherited from interface uka.graph.GraphNode
UNDEFINED_COLOR
 
Constructor Summary
ReplicatedServerRef.CollectiveUpdateNode(int size)
           
 
Method Summary
 int getColor(int rank)
          Gets the current color of the node with the given rank.
 IntIterator getColors()
           
 int getDegree()
          The degree of this graph node.
 IntIterator getNeighbors()
          Iterates over all ranks of which are connected to this node.
 int getRank()
          The rank of this graph node is unique among all nodes of the graph.
 IntIterator getRanks(int color)
           
 void init()
          This method is called before a coloring is computed.
 void setColor(int rank, int color)
          Sets the color of the node with the given rank.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

final int size

degree

int degree

colors

EnlargingIntArray colors
Constructor Detail

ReplicatedServerRef.CollectiveUpdateNode

public ReplicatedServerRef.CollectiveUpdateNode(int size)
Method Detail

init

public void init()
Description copied from interface: uka.graph.GraphNode
This method is called before a coloring is computed. If the graph is re-colored incrementally after a structural modification, this method is called again before the coloring algorihtm is restarted.

Specified by:
init in interface uka.graph.GraphNode

getDegree

public int getDegree()
Description copied from interface: uka.graph.GraphNode
The degree of this graph node.

Specified by:
getDegree in interface uka.graph.GraphNode

getRank

public int getRank()
Description copied from interface: uka.graph.GraphNode
The rank of this graph node is unique among all nodes of the graph.

Specified by:
getRank in interface uka.graph.GraphNode

getNeighbors

public IntIterator getNeighbors()
Description copied from interface: uka.graph.GraphNode
Iterates over all ranks of which are connected to this node.

Specified by:
getNeighbors in interface uka.graph.GraphNode

getColor

public int getColor(int rank)
Description copied from interface: uka.graph.GraphNode
Gets the current color of the node with the given rank. A call to this method is only valid, if the given rank is the rank of this node or a rank of a neighbor node.

Specified by:
getColor in interface uka.graph.GraphNode

setColor

public void setColor(int rank,
                     int color)
Description copied from interface: uka.graph.GraphNode
Sets the color of the node with the given rank. The same restriction as in GraphNode.getColor(int) applies.

Specified by:
setColor in interface uka.graph.GraphNode

getColors

public IntIterator getColors()
Returns:
a sequence of colors with with this node and neighbor nodes are colored.

getRanks

public IntIterator getRanks(int color)
Returns:
a sequence of ranks of neighbor nodes that are colored with the given color.