Package net.sf.saxon.ma.arrays
Class ArrayFunctionSet.ArrayGeneratingFunction
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.ma.arrays.ArrayFunctionSet.ArrayGeneratingFunction
- All Implemented Interfaces:
Callable
,Pingable
,FunctionItem
,GroundedValue
,Item
,Sequence
- Direct Known Subclasses:
ArrayFunctionSet.ArrayBuild
,ArrayFunctionSet.ArrayFilter
,ArrayFunctionSet.ArrayForEach
,ArrayFunctionSet.ArrayForEachPair
,ArrayFunctionSet.ArrayOfMembers
,ArrayFunctionSet.ArrayReverse
,ArraySort
- Enclosing class:
ArrayFunctionSet
public abstract static class ArrayFunctionSet.ArrayGeneratingFunction
extends SystemFunction
implements Pingable
Abstract superclass for functions that produce an array, and that decide what kind of array implementation
to use based on past experience. Specifically, if the generated array is frequently converted to
an ImmutableArrayItem, then the function ends up deciding to generate an ImmutableArrayItem in the
first place.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Get the estimated number of members in the array, based on past experienceprotected ArrayItem
makeArray
(List<GroundedValue> members) Construct an array, given a list of membersvoid
ping()
Callback function, invoked when a SimpleArrayItem created by this function needs to be converted to anImmutableArrayItem
Methods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.FunctionItem
getGenre
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
Method Details
-
ping
public void ping()Callback function, invoked when a SimpleArrayItem created by this function needs to be converted to anImmutableArrayItem
-
expectedSize
protected int expectedSize()Get the estimated number of members in the array, based on past experience- Returns:
- the average size of arrays previously created, plus a little margin for expansion
-
makeArray
Construct an array, given a list of members- Parameters:
members
- the members of the array- Returns:
- the constructed array
-