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 Details

    • ArrayGeneratingFunction

      public ArrayGeneratingFunction()
  • Method Details

    • ping

      public void ping()
      Callback function, invoked when a SimpleArrayItem created by this function needs to be converted to an ImmutableArrayItem
      Specified by:
      ping in interface Pingable
    • 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

      protected ArrayItem makeArray(List<GroundedValue> members)
      Construct an array, given a list of members
      Parameters:
      members - the members of the array
      Returns:
      the constructed array