org.ucl.xpath.function
Class FnCompare

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

public class FnCompare
extends Function

String comparison function.

Usage: fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:integer?

This class returns -1, 0, or 1, depending on whether the value of $comparand1 is respectively less than, equal to, or greater than the value of $comparand2.

If the value of $comparand2 begins with a string that is equal to the value of $comparand1 (according to the collation that is used) and has additional code points following that beginning string, then the result is -1. If the value of $comparand1 begins with a string that is equal to the value of $comparand2 and has additional code points following that beginning string, then the result is 1.

If either argument is the empty sequence, the result is the empty sequence.


Field Summary
 
Fields inherited from class org.ucl.xpath.function.Function
_arity, _fl, _name
 
Constructor Summary
FnCompare()
          Constructor of FnCompare.
 
Method Summary
static ResultSequence compare(java.util.Collection args)
          Compare the arguments.
 ResultSequence evaluate(java.util.Collection args)
          Evaluate the arguments.
static java.util.Collection expected_args()
          Calculate the expected arguments.
 
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

FnCompare

public FnCompare()
Constructor of FnCompare.

Method Detail

evaluate

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

Specified by:
evaluate in class Function
Parameters:
args - is evaluated.
Returns:
The evaluation of the comparison of the arguments.
Throws:
DynamicError - Dynamic error.

compare

public static ResultSequence compare(java.util.Collection args)
                              throws DynamicError
Compare the arguments.

Parameters:
args - are compared.
Returns:
The result of the comparison of the arguments.
Throws:
DynamicError - Dynamic error.

expected_args

public static java.util.Collection expected_args()
Calculate the expected arguments.

Returns:
The expected arguments.