org.ucl.xpath.function
Class FnExactlyOne

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

public class FnExactlyOne
extends Function

Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005]. 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
FnExactlyOne()
          Constructor for FnExactlyOne.
 
Method Summary
 ResultSequence evaluate(java.util.Collection args)
          Evaluate arguments.
static ResultSequence exactly_one(java.util.Collection args)
          Exactly-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

FnExactlyOne

public FnExactlyOne()
Constructor for FnExactlyOne.

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.

exactly_one

public static ResultSequence exactly_one(java.util.Collection args)
                                  throws DynamicError
Exactly-one operation.

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