org.planx.xmlstore.koala.nodes
Class DVMCharDataNode

java.lang.Object
  extended by org.planx.xmlstore.koala.nodes.AbstractDVMNode
      extended by org.planx.xmlstore.koala.nodes.DVMCharDataNode
All Implemented Interfaces:
SystemNode, Node

public class DVMCharDataNode
extends AbstractDVMNode

An immutable CHARDATA node.

Author:
Thomas Ambus

Field Summary
 
Fields inherited from interface org.planx.xmlstore.Node
BINARY, CHARDATA, ELEMENT
 
Constructor Summary
DVMCharDataNode(String value)
          Creates a CHARDATA node with the specified value.
DVMCharDataNode(String value, Locator loc, boolean isShared)
          Creates a CHARDATA node and sets its associated locator and isShared status.
 
Method Summary
 boolean equals(Object o)
          Only equal if object is a Node with the same type and same value.
 String getAttribute(String attrName)
          Always null.
 String[] getAttributeNames()
          Empty array.
 List<Attribute> getAttributes()
          Empty list.
 List<SystemNode> getChildren()
          Empty list.
 String getNodeValue()
          Returns the character data of this CHARDATA node.
 int hashCode()
          Recursively computes a hash code based on the node type, node value, attributes, and children.
 void setChild(int index, SystemNode child)
          Throws an IllegalArgumentException since CHARDATA nodes cannot have children.
 
Methods inherited from class org.planx.xmlstore.koala.nodes.AbstractDVMNode
contentEquals, getBytes, getLocator, getType, getValueReference, isMutable, isShared, setLocator, setValueReference, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DVMCharDataNode

public DVMCharDataNode(String value)
Creates a CHARDATA node with the specified value.


DVMCharDataNode

public DVMCharDataNode(String value,
                       Locator loc,
                       boolean isShared)
Creates a CHARDATA node and sets its associated locator and isShared status.

Method Detail

getNodeValue

public String getNodeValue()
Returns the character data of this CHARDATA node.

Returns:
The node value.

getChildren

public List<SystemNode> getChildren()
Empty list.

Returns:
An immutable list of the children of this Node.

getAttributes

public List<Attribute> getAttributes()
Empty list.

Returns:
An immutable list of the attributes of this Node.

getAttribute

public String getAttribute(String attrName)
Always null.

Returns:
The attribute named by the argument.

getAttributeNames

public String[] getAttributeNames()
Empty array.

Returns:
The attribute names of the node.

equals

public boolean equals(Object o)
Only equal if object is a Node with the same type and same value.

Specified by:
equals in interface Node
Overrides:
equals in class Object

hashCode

public int hashCode()
Description copied from interface: Node
Recursively computes a hash code based on the node type, node value, attributes, and children.

Specified by:
hashCode in interface Node
Overrides:
hashCode in class Object

setChild

public void setChild(int index,
                     SystemNode child)
Throws an IllegalArgumentException since CHARDATA nodes cannot have children.



Copyright © 2004-2005 Plan-X. All Rights Reserved.