org.ucl.xpath.function
Class FnRoundHalfToEven

java.lang.Object
  extended byorg.ucl.xpath.function.Function
      extended byorg.ucl.xpath.function.FnRoundHalfToEven

public class FnRoundHalfToEven
extends Function

The value returned is the nearest (that is, numerically closest) numeric to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), returns the one whose least significant digit is even. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the return is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the type of the return is the base numeric type.


Field Summary
 
Fields inherited from class org.ucl.xpath.function.Function
_arity, _fl, _name
 
Constructor Summary
FnRoundHalfToEven()
          Constructor for FnRoundHalfToEven.
 
Method Summary
 ResultSequence evaluate(java.util.Collection args)
          Evaluate arguments.
static ResultSequence fn_round_half_to_even(ResultSequence arg)
          Round-Half-to-Even operation.
 
Methods inherited from class org.ucl.xpath.function.Function
arity, convert_argument, convert_arguments, dynamic_context, name, set_function_library, signature, signature, signature, static_context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FnRoundHalfToEven

public FnRoundHalfToEven()
Constructor for FnRoundHalfToEven.

Method Detail

evaluate

public ResultSequence evaluate(java.util.Collection args)
                        throws DynamicError
Evaluate arguments.

Specified by:
evaluate in class Function
Parameters:
args - argument expressions.
Returns:
Result of evaluation.
Throws:
DynamicError - Dynamic error.

fn_round_half_to_even

public static ResultSequence fn_round_half_to_even(ResultSequence arg)
                                            throws DynamicError
Round-Half-to-Even operation.

Parameters:
arg - Result from the expressions evaluation.
Returns:
Result of fn:round-half-to-even operation.
Throws:
DynamicError - Dynamic error.