public abstract class DelegatingArrayItem extends AbstractArrayItem
DelegatingArrayItem is an abstract class representing an array that
is implemented by delegating all array-related functionality to a base class.
Unless any methods are overridden, the functionality is identical to that
of the wrapped array item.
Note that methods such as put(int, net.sf.saxon.om.GroundedValue<?>) that create a new array will
(unless overridden) simply delegate to the base array, and the new array will
therefore not be a delegating array.
SINGLE_ARRAY_TYPE| Constructor and Description |
|---|
DelegatingArrayItem(ArrayItem base) |
| Modifier and Type | Method and Description |
|---|---|
int |
arrayLength()
Get the number of members in the array
|
ArrayItem |
concat(ArrayItem other)
Concatenate this array with another
|
GroundedValue<?> |
get(int index)
Get a member of the array
|
ArrayItem |
getBaseItem() |
ArrayItem |
insert(int position,
GroundedValue<?> member)
Insert a new member into an array
|
boolean |
isEmpty()
Ask whether the array is empty
|
java.lang.Iterable<GroundedValue<?>> |
members()
Get the list of all members of the array
|
ArrayItem |
put(int index,
GroundedValue<?> newValue)
Replace a member of the array
|
ArrayItem |
remove(int index)
Remove a member from the array
|
ArrayItem |
removeSeveral(IntSet positions)
Remove zero or more members from the array
|
ArrayItem |
subArray(int start,
int end)
Get a sub-array given a start and end position
|
atomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getMemberType, getOperandRoles, getStringValue, getStringValueCS, isArray, isMap, isTrustedResultType, makeNewContext, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetGenre, toShortStringargumentArraygetLength, head, isStreamed, itemAt, iterate, iterator, reduce, subsequence, toGroundedValueasIterable, materializemakeRepeatablepublic DelegatingArrayItem(ArrayItem base)
public GroundedValue<?> get(int index) throws XPathException
ArrayItemindex - the position of the member to retrieve (zero-based)XPathException - if the index is out of rangepublic ArrayItem put(int index, GroundedValue<?> newValue) throws XPathException
ArrayItemindex - the position of the member to replace (zero-based)newValue - the replacement valueXPathException - if the index is out of rangepublic int arrayLength()
ArrayItemNote: the method always returns 1, because an array is an item
public boolean isEmpty()
ArrayItempublic java.lang.Iterable<GroundedValue<?>> members()
ArrayItempublic ArrayItem concat(ArrayItem other)
ArrayItemother - the second arraypublic ArrayItem remove(int index)
ArrayItemindex - the position of the member to be removed (zero-based)public ArrayItem removeSeveral(IntSet positions)
ArrayItempositions - the positions of the members to be removed (zero-based).
A value that is out of range is ignored.public ArrayItem subArray(int start, int end)
ArrayItemstart - the start position (zero based)end - the end position (the position of the first item not to be returned)
(zero based)public ArrayItem insert(int position, GroundedValue<?> member)
ArrayItemposition - the 0-based position that the new item will assumemember - the new member to be insertedpublic ArrayItem getBaseItem()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.