com.japisoft.xpath.function
Class AbstractFunction

java.lang.Object
  |
  +--com.japisoft.xpath.function.AbstractFunction
All Implemented Interfaces:
Function
Direct Known Subclasses:
Boolean, Ceiling, Concat, Contains, Count, False, Floor, Id, Lang, Last, LocalName, Name, NamespaceURI, NormalizeSpace, Not, Number, Position, Round, StartsWith, String, StringLength, SubString, SubStringAfter, SubStringBefore, Sum, Translate, True

public abstract class AbstractFunction
extends java.lang.Object
implements Function

AbstractFunction

Author:
(c) 2003 JAPISOFT

Constructor Summary
AbstractFunction()
           
 
Method Summary
 void checkOneNodeSet(FastVector arg)
          Throw a RuntimeException if arg has no single NodeSet argument
 void checkOneNumber(FastVector arg)
          Throw a RuntimeException if arg has no single NodeSet argument
 void checkOneParameter(FastVector arg)
          Throw a RuntimeException if arg has no single argument
 void checkOneString(FastVector arg)
          Throw a RuntimeException if arg has no 1 string argument
 void checkThreeStrings(FastVector arg)
          Throw a RuntimeException if arg has no 3 string arguments
 void checkTwoStrings(FastVector arg)
          Throw a RuntimeException if arg has no 2 string arguments
abstract  java.lang.Object eval(XPathContext context, FastVector arg)
          Evalute this function for this context and the following arguments
 java.lang.String getString1(XPathContext context, FastVector arg)
           
 java.lang.String getString2(XPathContext context, FastVector arg)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFunction

public AbstractFunction()
Method Detail

eval

public abstract java.lang.Object eval(XPathContext context,
                                      FastVector arg)
Evalute this function for this context and the following arguments

Specified by:
eval in interface Function
Parameters:
arg - a Vector value, this is the responsability of the function to test the argument type
Returns:
an Object value like Integer, Boolean, String or NodeSet

checkOneNumber

public void checkOneNumber(FastVector arg)
Throw a RuntimeException if arg has no single NodeSet argument


checkOneNodeSet

public void checkOneNodeSet(FastVector arg)
Throw a RuntimeException if arg has no single NodeSet argument


checkOneParameter

public void checkOneParameter(FastVector arg)
Throw a RuntimeException if arg has no single argument


checkOneString

public void checkOneString(FastVector arg)
Throw a RuntimeException if arg has no 1 string argument


checkTwoStrings

public void checkTwoStrings(FastVector arg)
Throw a RuntimeException if arg has no 2 string arguments


checkThreeStrings

public void checkThreeStrings(FastVector arg)
Throw a RuntimeException if arg has no 3 string arguments


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
only the class name without the package

getString1

public java.lang.String getString1(XPathContext context,
                                   FastVector arg)

getString2

public java.lang.String getString2(XPathContext context,
                                   FastVector arg)