gate.annotation
Class NodeImpl

java.lang.Object
  |
  +--gate.annotation.NodeImpl
All Implemented Interfaces:
Comparable, IdBearer, Node, Serializable

public class NodeImpl
extends Object
implements Node, Comparable

Provides an implementation for the interface gate.Node.

See Also:
Serialized Form

Field Summary
private static boolean DEBUG
          Debug flag
(package private)  Integer id
          The id of this node (used for persistency)
(package private)  Long offset
          The offset of this node
(package private) static long serialVersionUID
          Freeze the serialization UID.
 
Constructor Summary
NodeImpl(Integer id)
          Construction from id.
NodeImpl(Integer id, Long offset)
          Construction from id and offset.
 
Method Summary
 int compareTo(Object o)
          Ordering
 Integer getId()
          Returns the Id of the Node.
 Long getOffset()
          Offset (will be null when the node is not anchored)
(package private)  void setOffset(Long offset)
          To allow AnnotationSet to revise offsets during editing
 String toString()
          String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
Freeze the serialization UID.

See Also:
Constant Field Values

id

Integer id
The id of this node (used for persistency)


offset

Long offset
The offset of this node

Constructor Detail

NodeImpl

public NodeImpl(Integer id)
Construction from id. Creates an unrooted node.


NodeImpl

public NodeImpl(Integer id,
                Long offset)
Construction from id and offset.

Parameters:
id - the Id of the new node
offset - the (temporal) offset of the Node; Should be null for non-anchored nodes.
Method Detail

getId

public Integer getId()
Returns the Id of the Node.

Specified by:
getId in interface IdBearer

getOffset

public Long getOffset()
Offset (will be null when the node is not anchored)

Specified by:
getOffset in interface Node

toString

public String toString()
String representation

Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
              throws ClassCastException
Ordering

Specified by:
compareTo in interface Comparable
ClassCastException

setOffset

void setOffset(Long offset)
To allow AnnotationSet to revise offsets during editing