bcds.phison
Class Node

java.lang.Object
  extended by bcds.phison.Node
All Implemented Interfaces:
GraphIONode, java.lang.Comparable

public class Node
extends java.lang.Object
implements java.lang.Comparable, GraphIONode

Defines a node that can be used for (file) input/output with SimGraph.

This class handles the following node attributes:

Note that the node id can only be set at instantiation time. Thus, that attribute is ignored by setExtraArgs(bcds.tools.Environ).

Author:
Juan Segovia S.

Constructor Summary
Node(java.lang.String id)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare two nodes based on their ids.
 Environ dumpToEnviron()
          Called by GraphWriters's before "serializing" the vertex attributes.
 java.lang.String getId()
           
 java.lang.String getLabel()
           
 float getXCoord()
           
 float getYCoord()
           
 void setExtraArgs(Environ env)
          Called by GraphReader's to complete the initialization of a new vertex.
 void setLabel(java.lang.String s)
           
 void setXCoord(float xcoord)
           
 void setYCoord(float ycoord)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(java.lang.String id)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setLabel

public void setLabel(java.lang.String s)

setXCoord

public void setXCoord(float xcoord)

setYCoord

public void setYCoord(float ycoord)

getId

public java.lang.String getId()

getLabel

public java.lang.String getLabel()

getXCoord

public float getXCoord()

getYCoord

public float getYCoord()

compareTo

public int compareTo(java.lang.Object o)
Compare two nodes based on their ids. First, an attempt is made to intrepret their ids as an integer. If that fails, a string-based comparison is performed.

Specified by:
compareTo in interface java.lang.Comparable

setExtraArgs

public void setExtraArgs(Environ env)
Called by GraphReader's to complete the initialization of a new vertex.

Specified by:
setExtraArgs in interface GraphIONode

dumpToEnviron

public Environ dumpToEnviron()
Called by GraphWriters's before "serializing" the vertex attributes.

Specified by:
dumpToEnviron in interface GraphIONode