dk.brics.xmlgraph
Class Node

java.lang.Object
  extended by dk.brics.xmlgraph.Node
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
MultiContentNode, NoContentNode, SingleContentNode

public abstract class Node
extends Object
implements Cloneable, Serializable

Abstract superclass for nodes.

See Also:
Serialized Form

Field Summary
protected  int index
          Index of this node.
protected  Origin origin
          Origin of this node.
 
Constructor Summary
Node(Origin origin)
          Constructor for node objects.
 
Method Summary
protected abstract  Node clone()
          Clones this node.
 int getIndex()
          Returns the index of this node.
 Origin getOrigin()
          Returns the source information.
abstract
<T> T
process(NodeProcessor<T> v)
          Applies the given node processor on this node.
 void setOrigin(Origin origin)
          Sets the source information.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

protected int index
Index of this node.


origin

protected Origin origin
Origin of this node.

Constructor Detail

Node

public Node(Origin origin)
Constructor for node objects.

Parameters:
origin - source information (null if not applicable)
Method Detail

clone

protected abstract Node clone()
Clones this node.

Overrides:
clone in class Object

getIndex

public int getIndex()
Returns the index of this node.

Returns:
index

getOrigin

public Origin getOrigin()
Returns the source information.

Returns:
source information (null if none available)

process

public abstract <T> T process(NodeProcessor<T> v)
Applies the given node processor on this node.

Type Parameters:
T - return type
Parameters:
v - node processor
Returns:
result from processor

setOrigin

public void setOrigin(Origin origin)
Sets the source information.

Parameters:
origin - source information (null if not applicable)


Copyright © 2005-2010 Anders Møller.