net.sf.saxon.expr
Class UserFunctionCall.FunctionCallPackage

java.lang.Object
  extended bynet.sf.saxon.value.Value
      extended bynet.sf.saxon.value.AtomicValue
          extended bynet.sf.saxon.value.ObjectValue
              extended bynet.sf.saxon.expr.UserFunctionCall.FunctionCallPackage
All Implemented Interfaces:
Expression, Item, java.io.Serializable, ValueRepresentation
Enclosing class:
UserFunctionCall

public class UserFunctionCall.FunctionCallPackage
extends ObjectValue

Inner class used to wrap up the set of actual arguments to a tail-recursive call of the containing function. This argument package is passed back to the calling code in place of a function result; the caller then loops to re-invoke the function with these arguments, avoiding the creation of an additional stack frame.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
 
Constructor Summary
UserFunctionCall.FunctionCallPackage(UserFunction function, ValueRepresentation[] actualArgs, XPathContext c)
           
 
Method Summary
 ValueRepresentation call()
           
 ItemType getItemType(TypeHierarchy th)
          Determine the item type of the expression
 AtomicValue getPrimitiveValue()
          Get the primitive value (the value in the value space).
 SequenceIterator iterateResults(XPathContext context)
           
 Value reduce()
          Reduce a value to its simplest form.
 
Methods inherited from class net.sf.saxon.value.ObjectValue
convertPrimitive, convertToJava, effectiveBooleanValue, equals, getObject, getStringValue, hashCode, setValue
 
Methods inherited from class net.sf.saxon.value.AtomicValue
checkPermittedContents, convert, convert, display, evaluateAsString, evaluateItem, getCardinality, getComponent, getImplementationMethod, getLength, getStringValueCS, getTypedValue, hasBuiltInType, iterate, process, schemaEquals, toString
 
Methods inherited from class net.sf.saxon.value.Value
asItem, asIterator, asValue, collapseWhitespace, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, normalizeWhitespace, optimize, promote, simplify, stringToNumber, trimWhitespace, typeCheck
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserFunctionCall.FunctionCallPackage

public UserFunctionCall.FunctionCallPackage(UserFunction function,
                                            ValueRepresentation[] actualArgs,
                                            XPathContext c)
Method Detail

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the item type of the expression

Specified by:
getItemType in interface Expression
Overrides:
getItemType in class ObjectValue
Parameters:
th -
Returns:
Type.OBJECT

call

public ValueRepresentation call()
                         throws XPathException
Throws:
XPathException

iterateResults

public SequenceIterator iterateResults(XPathContext context)
                                throws XPathException
Throws:
XPathException

reduce

public Value reduce()
             throws XPathException
Reduce a value to its simplest form. If the value is a closure or some other form of deferred value such as a FunctionCallPackage, then it is reduced to a SequenceExtent. If it is a SequenceExtent containing a single item, then it is reduced to that item. One consequence that is exploited by class FilterExpression is that if the value is a singleton numeric value, then the result will be an instance of NumericValue

Overrides:
reduce in class Value
Throws:
XPathException

getPrimitiveValue

public AtomicValue getPrimitiveValue()
Get the primitive value (the value in the value space). This returns an AtomicValue of a class that would be used to represent the primitive value. In effect this means that for built-in types, it returns the value itself, but for user-defined type, it returns the primitive value minus the type annotation. Note that getItemType() when applied to the result of this function does not not necessarily return a primitive type: for example, this function may return a value of type xdt:dayTimeDuration, which is not a primitive type as defined by Type.isPrimitiveType(int)

Overrides:
getPrimitiveValue in class AtomicValue