Package com.saxonica.xsltextn.pedigree
Class PedigreeArrayItem
- java.lang.Object
-
- net.sf.saxon.ma.arrays.AbstractArrayItem
-
- com.saxonica.xsltextn.pedigree.DelegatingArrayItem
-
- com.saxonica.xsltextn.pedigree.PedigreeArrayItem
-
- All Implemented Interfaces:
PedigreeValue,Callable,ArrayItem,Function,GroundedValue,Item,Sequence
public class PedigreeArrayItem extends DelegatingArrayItem implements PedigreeValue
A PedigreeArrayItem represents an XDM array together with aPedigree: that is, retained information about how the array was selected with a JSON-like tree.
-
-
Field Summary
-
Fields inherited from interface net.sf.saxon.ma.arrays.ArrayItem
SINGLE_ARRAY_TYPE
-
-
Constructor Summary
Constructors Constructor Description PedigreeArrayItem(ArrayItem base)Create a PedigreeArrayItem with an empty pedigreePedigreeArrayItem(ArrayItem base, Pedigree pedigree)Create a PedigreeArrayItem with a known pedigree
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroundedValueget(int index)Get the member of the array at a specified index, retaining information about how that member was selectedPedigreegetPedigree()Get the pedigree of this array item, providing information as to how it was selected.java.lang.Iterable<GroundedValue>members()Return the members of the array as an iterable collectionArrayItemremove(int index)Get all members of the array except that at a specified position, retaining information about how the remaining members were selectedArrayItemsubArray(int start, int end)Get a sub-array given a start and end position-
Methods inherited from class com.saxonica.xsltextn.pedigree.DelegatingArrayItem
arrayLength, concat, getBaseItem, insert, isEmpty, put, removeSeveral
-
Methods inherited from class net.sf.saxon.ma.arrays.AbstractArrayItem
atomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getMemberType, getOperandRoles, getStringValue, getStringValueCS, isArray, isMap, isTrustedResultType, makeNewContext, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.ma.arrays.ArrayItem
getGenre, toShortString
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
-
Methods inherited from interface com.saxonica.xsltextn.pedigree.PedigreeValue
getBaseItem, getOrigin
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Constructor Detail
-
PedigreeArrayItem
public PedigreeArrayItem(ArrayItem base)
Create a PedigreeArrayItem with an empty pedigree- Parameters:
base- the underlying array item
-
-
Method Detail
-
get
public GroundedValue get(int index)
Get the member of the array at a specified index, retaining information about how that member was selected- Specified by:
getin interfaceArrayItem- Overrides:
getin classDelegatingArrayItem- Parameters:
index- the zero-based subscript of the selected member of the array- Returns:
- the requested array member, which will itself have a pedigree if it is a singleton map or array.
- Throws:
java.lang.IndexOutOfBoundsException- if the index is out of bounds
-
remove
public ArrayItem remove(int index)
Get all members of the array except that at a specified position, retaining information about how the remaining members were selected- Specified by:
removein interfaceArrayItem- Overrides:
removein classDelegatingArrayItem- Parameters:
index- the zero-based subscript of the member of the array that is to be removed- Returns:
- the remaining array members, which will themselves have a pedigree (indicating their original position in the original array) in the case of members that are singleton maps or arrays.
- Throws:
java.lang.IndexOutOfBoundsException- if the index is out of bounds
-
subArray
public ArrayItem subArray(int start, int end)
Description copied from interface:ArrayItemGet a sub-array given a start and end position- Specified by:
subArrayin interfaceArrayItem- Overrides:
subArrayin classDelegatingArrayItem- Parameters:
start- the start position (zero based)end- the end position (the position of the first item not to be returned) (zero based)- Returns:
- a new array item containing the sub-array
-
members
public java.lang.Iterable<GroundedValue> members()
Return the members of the array as an iterable collection- Specified by:
membersin interfaceArrayItem- Overrides:
membersin classDelegatingArrayItem- Returns:
- the members of the array as an iterable collection. Any members that are singleton maps or arrays will have a pedigree indicating how they were selected.
-
getPedigree
public Pedigree getPedigree()
Get the pedigree of this array item, providing information as to how it was selected.- Specified by:
getPedigreein interfacePedigreeValue- Returns:
- the pedigree of this array item
-
-