clark.xpath
Class AtomicObject

java.lang.Object
  |
  +--clark.xpath.GeneralNode
        |
        +--clark.xpath.AtomicObject
All Implemented Interfaces:
java.io.Serializable

public class AtomicObject
extends GeneralNode
implements java.io.Serializable

This object is used to represent the atomic values: Node, Nodeset, number, boolean, String. It has two attributes: type and target. The type attribute is a short, which indicates the type of data in the target attribute. The type is needed for faster object class identification.

See Also:
Serialized Form

Constructor Summary
AtomicObject(short nType, java.lang.Object nTarget)
           
 
Method Summary
 boolean checkNodeListResult()
          Checks whether the instances of this class will produce a node-list with method eval()
 clark.xpath.AtomicObject eval(w3c.dom.Node context)
          The method in all successor classes of GeneralNode overides one and the same method.
 short getNodeType()
          Return the type of this object.
 short getReturnType()
          Returns the expected return type after the evaluation
 java.lang.Object getTarget()
          Returns the target object of the class.
 short getType()
          Returns the type of the object in the target attribute.
 void setTarget(java.lang.Object newTarget)
          Sets a new target object to this object.
 void setType(short newType)
          Sets a new type for the target of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomicObject

public AtomicObject(short nType,
                    java.lang.Object nTarget)
Method Detail

getType

public short getType()
Returns the type of the object in the target attribute.


getNodeType

public short getNodeType()
Return the type of this object. All successor classes s of GeneralNode have an unique type.

Specified by:
getNodeType in class GeneralNode

getTarget

public java.lang.Object getTarget()
Returns the target object of the class.


setType

public void setType(short newType)
Sets a new type for the target of this object.


setTarget

public void setTarget(java.lang.Object newTarget)
Sets a new target object to this object.


eval

public clark.xpath.AtomicObject eval(w3c.dom.Node context)
                              throws ParseException
The method in all successor classes of GeneralNode overides one and the same method. The purpose of this method is to evaluate each object without knowing its specific class. Each such a method returns an AtomicObject. In this case it returns itself.

Specified by:
eval in class GeneralNode
ParseException

checkNodeListResult

public boolean checkNodeListResult()
Description copied from class: GeneralNode
Checks whether the instances of this class will produce a node-list with method eval()

Specified by:
checkNodeListResult in class GeneralNode

getReturnType

public short getReturnType()
Description copied from class: GeneralNode
Returns the expected return type after the evaluation

Specified by:
getReturnType in class GeneralNode