org.ucl.xpath.function
Class Function

java.lang.Object
  extended byorg.ucl.xpath.function.Function
Direct Known Subclasses:
Constructor, FnAbs, FnAvg, FnBaseUri, FnBoolean, FnCeiling, FnCodepointsToString, FnCompare, FnConcat, FnContains, FnCount, FnCurrentDate, FnCurrentDateTime, FnCurrentTime, FnData, FnDayFromDate, FnDayFromDateTime, FnDaysFromDuration, FnDeepEqual, FnDistinctValues, FnDoc, FnDocumentUri, FnDummy, FnEmpty, FnEndsWith, FnError, FnEscapeUri, FnExactlyOne, FnExists, FnFalse, FnFloor, FnHoursFromDateTime, FnHoursFromDuration, FnHoursFromTime, FnImplicitTimezone, FnIndexOf, FnInsertBefore, FnLang, FnLast, FnLocalName, FnLocalNameFromQName, FnLowerCase, FnMatches, FnMax, FnMin, FnMinutesFromDateTime, FnMinutesFromDuration, FnMinutesFromTime, FnMonthFromDate, FnMonthFromDateTime, FnMonthsFromDuration, FnName, FnNamespaceUri, FnNamespaceUriFromQName, FnNilled, FnNodeName, FnNormalizeSpace, FnNot, FnNumber, FnOneOrMore, FnPosition, FnQName, FnRemove, FnReplace, FnResolveQName, FnReverse, FnRoot, FnRound, FnRoundHalfToEven, FnSecondsFromDateTime, FnSecondsFromDuration, FnSecondsFromTime, FnStartsWith, FnStaticBaseUri, FnString, FnStringJoin, FnStringLength, FnStringToCodepoints, FnSubsequence, FnSubstring, FnSubstringAfter, FnSubstringBefore, FnSum, FnTimezoneFromDate, FnTimezoneFromDateTime, FnTimezoneFromTime, FnTokenize, FnTrace, FnTranslate, FnTrue, FnUnordered, FnUpperCase, FnYearFromDate, FnYearFromDateTime, FnYearsFromDuration, FnZeroOrOne, FsConvertOperand, FsDiv, FsEq, FsGe, FsGt, FsIDiv, FsLe, FsLt, FsMinus, FsMod, FsNe, FsPlus, FsTimes, OpExcept, OpIntersect, OpTo, OpUnion

public abstract class Function
extends java.lang.Object

Support for functions.


Field Summary
protected  int _arity
           
protected  FunctionLibrary _fl
           
protected  QName _name
           
 
Constructor Summary
Function(QName name, int arity)
          Constructor for Function.
 
Method Summary
 int arity()
          Support for int interface.
static ResultSequence convert_argument(ResultSequence arg, SeqType expected)
          Convert the input argument according to section 3.1.5 of specification.
static java.util.Collection convert_arguments(java.util.Collection args, java.util.Collection expected)
          Convert arguments.
protected  DynamicContext dynamic_context()
           
abstract  ResultSequence evaluate(java.util.Collection args)
          Evaluate arguments.
 QName name()
          Support for QName interface.
 void set_function_library(FunctionLibrary fl)
          Set the function library variable.
 java.lang.String signature()
          Default constructor for signature.
static java.lang.String signature(Function f)
          Obtain the function name and arity from signature.
static java.lang.String signature(QName name, int arity)
          Apply the name and arity to signature.
protected  StaticContext static_context()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected QName _name

_arity

protected int _arity

_fl

protected FunctionLibrary _fl
Constructor Detail

Function

public Function(QName name,
                int arity)
Constructor for Function.

Parameters:
name - QName.
arity - the arity of a specific function.
Method Detail

name

public QName name()
Support for QName interface.

Returns:
Result of QName operation.

arity

public int arity()
Support for int interface.

Returns:
Result of int operation.

signature

public java.lang.String signature()
Default constructor for signature.

Returns:
Signature.

signature

public static java.lang.String signature(Function f)
Obtain the function name and arity from signature.

Parameters:
f - current function.
Returns:
Signature.

signature

public static java.lang.String signature(QName name,
                                         int arity)
Apply the name and arity to signature.

Parameters:
name - QName.
arity - arity of the function.
Returns:
Signature.

evaluate

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

Parameters:
args - argument expressions.
Returns:
Result of evaluation.
Throws:
DynamicError - Dynamic error.

convert_argument

public static ResultSequence convert_argument(ResultSequence arg,
                                              SeqType expected)
                                       throws DynamicError
Convert the input argument according to section 3.1.5 of specification.

Parameters:
arg - input argument.
expected - Expected Sequence type.
Returns:
Converted argument.
Throws:
DynamicError - Dynamic error.

convert_arguments

public static java.util.Collection convert_arguments(java.util.Collection args,
                                                     java.util.Collection expected)
                                              throws DynamicError
Convert arguments.

Parameters:
args - input arguments.
expected - expected arguments.
Returns:
Converted arguments.
Throws:
DynamicError - Dynamic error.

set_function_library

public void set_function_library(FunctionLibrary fl)
Set the function library variable.

Parameters:
fl - Function Library.

static_context

protected StaticContext static_context()

dynamic_context

protected DynamicContext dynamic_context()