org.ucl.xpath.function
Class FnZeroOrOne

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

public class FnZeroOrOne
extends Function

Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003]. The type of the result depends on the type of $arg.


Field Summary
 
Fields inherited from class org.ucl.xpath.function.Function
_arity, _fl, _name
 
Constructor Summary
FnZeroOrOne()
          Constructor for FnZeroOrOne.
 
Method Summary
 ResultSequence evaluate(java.util.Collection args)
          Evaluate arguments.
static ResultSequence zero_or_one(java.util.Collection args)
          Zero-or-One 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

FnZeroOrOne

public FnZeroOrOne()
Constructor for FnZeroOrOne.

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.

zero_or_one

public static ResultSequence zero_or_one(java.util.Collection args)
                                  throws DynamicError
Zero-or-One operation.

Parameters:
args - Result from the expressions evaluation.
Returns:
Result of fn:zero-or-one operation.
Throws:
DynamicError - Dynamic error.