public interface ArrayItem extends Function, java.lang.Iterable<Sequence>
Modifier and Type | Field and Description |
---|---|
static SequenceType |
SINGLE_ARRAY_TYPE |
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
|
Sequence |
get(int index)
Get a member of the array
|
java.util.List<Sequence> |
getMembers()
Get a list of the members of the array
|
SequenceType |
getMemberType(TypeHierarchy th)
Get the lowest common item type of the members of the array
|
boolean |
isEmpty()
Ask whether the array is empty
|
java.util.Iterator<Sequence> |
iterator()
Get the list of all members of the array
|
ArrayItem |
put(int index,
Sequence 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
|
call, deepEquals, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getOperandRoles, isArray, isMap, isTrustedResultType, iterate, makeNewContext
atomize, getStringValue, getStringValueCS, head
effectiveBooleanValue, getLength, getStringValue, getStringValueCS, head, itemAt, reduce, subsequence
static final SequenceType SINGLE_ARRAY_TYPE
Sequence get(int index) throws XPathException
index
- the position of the member to retrieve (zero-based)XPathException
- if the index is out of rangeArrayItem put(int index, Sequence newValue) throws XPathException
index
- the position of the member to replace (zero-based)newValue
- the replacement valueXPathException
- if the index is out of rangeint arrayLength()
Note: the method always returns 1, because an array is an item
boolean isEmpty()
java.util.Iterator<Sequence> iterator()
iterator
in interface java.lang.Iterable<Sequence>
ArrayItem concat(ArrayItem other)
other
- the second arrayArrayItem remove(int index)
index
- the position of the member to be removed (zero-based)java.lang.IndexOutOfBoundsException
- if index is out of rangeArrayItem removeSeveral(IntSet positions)
positions
- the positions of the members to be removed (zero-based).
A value that is out of range is ignored.SequenceType getMemberType(TypeHierarchy th)
java.util.List<Sequence> getMembers()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.