Package com.saxonica.functions.qt4.pin
Class LabeledArrayItem
java.lang.Object
net.sf.saxon.ma.MapOrArray
net.sf.saxon.ma.arrays.ArrayItem
net.sf.saxon.ma.arrays.AbstractArrayItem
com.saxonica.xsltextn.pedigree.DelegatingArrayItem
com.saxonica.functions.qt4.pin.LabeledArrayItem
- All Implemented Interfaces:
LabeledItem,Callable,FunctionItem,GroundedValue,Item,Sequence
A
LabeledArrayItem represents an XDM array together with a label, which is a map:
generally containing retained information about how the array was selected within a JSON-like tree.-
Constructor Summary
ConstructorsConstructorDescriptionLabeledArrayItem(ArrayItem base, MapItem label) Create a PedigreeArrayItem with an empty pedigree -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Get the member of the array at a specified index, retaining information about how that member was selectedgetIfPresent(int index) Get a member of the array at a specific offset, or an empty sequence if the supplied offset is out of rangegetLabel()Get the pedigree of this array item, providing information as to how it was selected.Get the subject item without its labelstatic LabeledArrayItemmakePinnedArrayItem(ArrayItem base) members()Get the list of all members of the arrayremove(int index) Get all members of the array except that at a specified position, retaining information about how the remaining members were selectedremoveSeveral(IntSet positions) Remove zero or more members from the arraysubArray(int start, int end) Get a sub-array given a start and end positiontoString()Output a string representation of the array, suitable for diagnosticsMethods inherited from class com.saxonica.xsltextn.pedigree.DelegatingArrayItem
append, arrayLength, concat, insert, isEmpty, putMethods inherited from class net.sf.saxon.ma.arrays.AbstractArrayItem
atomize, call, deepEqual40, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getMemberType, getOperandRoles, getUnicodeStringValue, isTrustedResultType, makeNewContextMethods inherited from class net.sf.saxon.ma.arrays.ArrayItem
getGenre, isArray, isMap, parcels, toShortStringMethods inherited from class net.sf.saxon.ma.MapOrArray
obtainRootJNodeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.FunctionItem
isSequenceVariadicMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
atomize, getLength, getStringValue, getUnicodeStringValue, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
LabeledArrayItem
Create a PedigreeArrayItem with an empty pedigree- Parameters:
base- the underlying array item
-
-
Method Details
-
getSubject
Description copied from interface:LabeledItemGet the subject item without its label- Specified by:
getSubjectin interfaceLabeledItem- Returns:
- the subject item
-
makePinnedArrayItem
-
get
Get the member of the array at a specified index, retaining information about how that member was selected- 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:
IndexOutOfBoundsException- if the index is out of bounds
-
getIfPresent
Get a member of the array at a specific offset, or an empty sequence if the supplied offset is out of range- Overrides:
getIfPresentin classDelegatingArrayItem- Parameters:
index- the position of the member to retrieve (zero-based)- Returns:
- the value at the given position, or an empty sequence if the index is out of range
-
members
Description copied from class:ArrayItemGet the list of all members of the array- Overrides:
membersin classDelegatingArrayItem- Returns:
- an iterator over the members of the array
-
remove
Get all members of the array except that at a specified position, retaining information about how the remaining members were selected- 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:
IndexOutOfBoundsException- if the index is out of bounds
-
removeSeveral
Description copied from class:ArrayItemRemove zero or more members from the array- Overrides:
removeSeveralin classDelegatingArrayItem- Parameters:
positions- the positions of the members to be removed (zero-based). A value that is out of range is ignored.- Returns:
- a new array in which the requested member has been removed
-
subArray
Get a sub-array given a start and end position- 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
- Throws:
IndexOutOfBoundsException- if start, or start+end, is out of range
-
getLabel
Get the pedigree of this array item, providing information as to how it was selected.- Specified by:
getLabelin interfaceItem- Specified by:
getLabelin interfaceLabeledItem- Returns:
- the pedigree of this array item
-
getBaseItem
- Overrides:
getBaseItemin classDelegatingArrayItem
-
toString
Description copied from class:AbstractArrayItemOutput a string representation of the array, suitable for diagnostics- Overrides:
toStringin classAbstractArrayItem
-