org.ucl.xpath.function
Class FnAbs
java.lang.Object
org.ucl.xpath.function.Function
org.ucl.xpath.function.FnAbs
- public class FnAbs
- extends Function
Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise
returns $arg. 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.
For xs:float and xs:double arguments, if the argument is positive zero (+0) or
negative zero (-0), then positive zero (+0) is returned. If the argument is positive
or negative infinity, positive infinity is returned.
Constructor Summary |
FnAbs()
Constructor for FnAbs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FnAbs
public FnAbs()
- Constructor for FnAbs.
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_abs
public static ResultSequence fn_abs(ResultSequence arg)
throws DynamicError
- Absolute value operation.
- Parameters:
arg
- Result from the expressions evaluation.
- Returns:
- Result of fn:abs operation.
- Throws:
DynamicError
- Dynamic error.
get_single_numeric_arg
public static NumericType get_single_numeric_arg(ResultSequence arg)
throws DynamicError
- Obtain numeric value from expression.
- Parameters:
arg
- input expression.
- Returns:
- Resulting numeric type from the operation.
- Throws:
DynamicError
- Dynamic error.