uk.ac.ic.doc.automed.util.graph.impl
Class Node

java.lang.Object
  extended by uk.ac.ic.doc.automed.util.graph.impl.Node
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DNode, ProcessNode

public class Node
extends java.lang.Object
implements java.io.Serializable

Node.java

Version:
1.0 Department of Computing, Imperial College
Author:
Duc M Le dmle@doc.ic.ac.uk
See Also:
Serialized Form

Field Summary
protected static java.lang.String colon
           
private  java.lang.Object data
           
private  long id
           
private static long idCounter
           
protected static java.lang.String pref
           
private static long serialVersionUID
           
private  int tag
           
 
Constructor Summary
  Node(java.lang.Object data)
          Creates a new instance of Node
private Node(java.lang.Object data, int id, int tag)
          Used for copy operation
 
Method Summary
 void clear()
           
 Node copy()
           
 boolean equals(java.lang.Object obj)
          Returns true if this node has the same ID as another node.
This method is used for inserting and retrieving Node objects in a collection.
 boolean equalsData(Node on)
          Returns true if this node has the same data as another node.
protected  void finalize()
           
 java.lang.Object getData()
           
 long getID()
           
 int getTag()
           
 int hashCode()
           
private  void readObject(java.io.ObjectInputStream in)
           
 void setData(java.lang.Object data)
           
 int setTag(int tag)
           
 java.lang.String toString()
           
private  void writeObject(java.io.ObjectOutputStream out)
          customise serialisable so that we can also serialise the static id counter
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

id

private long id

idCounter

private static volatile long idCounter

data

private java.lang.Object data

pref

protected static final java.lang.String pref
See Also:
Constant Field Values

colon

protected static final java.lang.String colon
See Also:
Constant Field Values

tag

private int tag
Constructor Detail

Node

public Node(java.lang.Object data)
Creates a new instance of Node


Node

private Node(java.lang.Object data,
             int id,
             int tag)
Used for copy operation

Parameters:
data -
id -
Method Detail

getTag

public int getTag()

setTag

public int setTag(int tag)

getData

public java.lang.Object getData()

setData

public void setData(java.lang.Object data)

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clear

public void clear()

getID

public long getID()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

equals

public boolean equals(java.lang.Object obj)
Returns true if this node has the same ID as another node.
This method is used for inserting and retrieving Node objects in a collection.

Overrides:
equals in class java.lang.Object

equalsData

public boolean equalsData(Node on)
Returns true if this node has the same data as another node.

Parameters:
on -
Returns:

copy

public Node copy()

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
customise serialisable so that we can also serialise the static id counter

Parameters:
out -
Throws:
java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException