clark.xpath
Class FunctionCallObject

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

public class FunctionCallObject
extends GeneralNode
implements java.io.Serializable

FunctionCallObject is a specific node in the tree representation of the XPath. It represents a function call. For more details see GeneralNode.

See Also:
Serialized Form

Constructor Summary
FunctionCallObject(short name_, short arity)
          Creates a new function call object with name identifier name_ and arity.
 
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)
          Evaluates this function call object.
 clark.xpath.GeneralNode[] getArguments()
          Returns the arguments of this function node.
 short getArity()
          Returns the arity of the function this node represents.
 short getName()
          Returns the function name identifier of this node.
 short getNodeType()
          Returns the type of this node(Defs.FUNCTION_CALL).
 short getReturnType()
          Returns the expected return type after the evaluation
 void setArgument(short index, clark.xpath.GeneralNode argument)
          Sets a new value for a certain argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionCallObject

public FunctionCallObject(short name_,
                          short arity)
Creates a new function call object with name identifier name_ and arity.

Method Detail

setArgument

public void setArgument(short index,
                        clark.xpath.GeneralNode argument)
Sets a new value for a certain argument. The value itself is a XPath expression tree.


getName

public short getName()
Returns the function name identifier of this node. All identifiers are defined in Defs.java.


getArity

public short getArity()
Returns the arity of the function this node represents.


getArguments

public clark.xpath.GeneralNode[] getArguments()
Returns the arguments of this function node.


getNodeType

public short getNodeType()
Returns the type of this node(Defs.FUNCTION_CALL).

Specified by:
getNodeType in class GeneralNode

eval

public clark.xpath.AtomicObject eval(w3c.dom.Node context)
                              throws ParseException
Evaluates this function call object. First its arguments are evaluated one by one, then Executor module is called with a function name and the evaluated arguments. This method overrides the same one in GeneralNode. The idea is that an evaluation of any node can be done without knowing its specific type.

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