com.japisoft.xpath.function.basic
Class Number

java.lang.Object
  |
  +--com.japisoft.xpath.function.AbstractFunction
        |
        +--com.japisoft.xpath.function.basic.Number
All Implemented Interfaces:
Function

public final class Number
extends AbstractFunction

function converts its argument to a number as follows: a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN boolean true is converted to 1; boolean false is converted to 0 a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument an object of a type other than the four basic types is converted to a number in a way that is dependent on that type

Author:
(c) 2003 JAPISOFT

Constructor Summary
Number()
           
 
Method Summary
 java.lang.Object eval(XPathContext context, FastVector arg)
          Evalute this function for this context and the following arguments
 
Methods inherited from class com.japisoft.xpath.function.AbstractFunction
checkOneNodeSet, checkOneNumber, checkOneParameter, checkOneString, checkThreeStrings, checkTwoStrings, getString1, getString2, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Number

public Number()
Method Detail

eval

public java.lang.Object eval(XPathContext context,
                             FastVector arg)
Description copied from class: AbstractFunction
Evalute this function for this context and the following arguments

Specified by:
eval in interface Function
Specified by:
eval in class AbstractFunction
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