clark.xpath
Class UnaryObject

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

public class UnaryObject
extends GeneralNode
implements java.io.Serializable

This object represents in general an unary operation, like (- number). It has two attributes: type - an identifier, representing the operation. For details, see Defs class; argument - a GeneralNode, representing the first operand when to it is applied eval()

See Also:
Serialized Form

Constructor Summary
UnaryObject(short operation_, clark.xpath.GeneralNode arg)
           
 
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)
          Each successor class of GeneralNode has its own method eval() for its specific evaluation.
 short getNodeType()
          Returns the type of the node.
 short getReturnType()
          Returns the expected return type after the evaluation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnaryObject

public UnaryObject(short operation_,
                   clark.xpath.GeneralNode arg)
Method Detail

getNodeType

public short getNodeType()
Returns the type of the node. It overrides the same one from GeneralNode and here it returns the operation for this node.

Specified by:
getNodeType in class GeneralNode

eval

public clark.xpath.AtomicObject eval(w3c.dom.Node context)
                              throws ParseException
Each successor class of GeneralNode has its own method eval() for its specific evaluation. The first thing here is to evaluate the argument and if its result is a number then apply the operation.

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