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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGenre, toShortString
argumentArray
getLength, head, isStreamed, itemAt, iterate, iterator, reduce, subsequence, toGroundedValue
asIterable, materialize
makeRepeatable
public DelegatingArrayItem(ArrayItem base)
public GroundedValue<?> get(int index) throws XPathException
ArrayItem
index
- 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
ArrayItem
index
- the position of the member to replace (zero-based)newValue
- the replacement valueXPathException
- if the index is out of rangepublic int arrayLength()
ArrayItem
Note: the method always returns 1, because an array is an item
public boolean isEmpty()
ArrayItem
public java.lang.Iterable<GroundedValue<?>> members()
ArrayItem
public ArrayItem concat(ArrayItem other)
ArrayItem
other
- the second arraypublic ArrayItem remove(int index)
ArrayItem
index
- the position of the member to be removed (zero-based)public ArrayItem removeSeveral(IntSet positions)
ArrayItem
positions
- 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)
ArrayItem
start
- 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)
ArrayItem
position
- 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.