clark.xpath
Class BinaryObject

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

public class BinaryObject
extends GeneralNode
implements java.io.Serializable

This object represents in general a binary operation, like unification, +, -, *, dev, mod, logicals: and, or. It has three attributes: type - an identifier, representing the operation. For details, see Defs class; left - a GeneralNode, representing the first operand when to it is applied eval() right - a GeneralNode, representing the second operand when to it is applied eval()

See Also:
Serialized Form

Constructor Summary
BinaryObject(short newOp, clark.xpath.GeneralNode left_, clark.xpath.GeneralNode right_)
           
 
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 operation in the node.
 short getReturnType()
          Returns the expected return type after the evaluation
 void setLeftOperand(clark.xpath.GeneralNode left_)
          Sets a new left operand.
 void setRightOperand(clark.xpath.GeneralNode right_)
          Sets a new right operand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryObject

public BinaryObject(short newOp,
                    clark.xpath.GeneralNode left_,
                    clark.xpath.GeneralNode right_)
Method Detail

getNodeType

public short getNodeType()
Returns the operation in the node.

Specified by:
getNodeType in class GeneralNode

setLeftOperand

public void setLeftOperand(clark.xpath.GeneralNode left_)
Sets a new left operand.


setRightOperand

public void setRightOperand(clark.xpath.GeneralNode right_)
Sets a new right operand.


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 a check for the operation, and according to it different methods are called.

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