public class SimpleArrayItem extends AbstractArrayItem implements ArrayItem
| Modifier and Type | Field and Description |
|---|---|
static SimpleArrayItem |
EMPTY_ARRAY
Static constant value representing an empty array
|
SINGLE_ARRAY_TYPE| Constructor and Description |
|---|
SimpleArrayItem(java.util.List<GroundedValue<? extends Item>> members)
Construct an array whose members are arbitrary sequences
|
| Modifier and Type | Method and Description |
|---|---|
int |
arrayLength()
Get the size of the array
|
ArrayItem |
concat(ArrayItem other)
Concatenate this array with another
|
GroundedValue |
get(int index)
Get a member of the array
|
AnnotationList |
getAnnotations()
Get the function annotations (as defined in XQuery).
|
java.util.List<GroundedValue<? extends Item>> |
getMembers()
Get a list of the members of the array
|
OperandRole[] |
getOperandRoles()
Get the roles of the arguments, for the purposes of streaming
|
ArrayItem |
insert(int position,
GroundedValue member)
Insert a new member into an array
|
boolean |
isArray()
Ask whether this function item is an array
|
boolean |
isEmpty()
Ask whether the array is empty
|
boolean |
isMap()
Ask whether this function item is a map
|
void |
makeGrounded()
Ensure that all the members are grounded.
|
static SimpleArrayItem |
makeSimpleArrayItem(SequenceIterator<? extends Item> input)
Construct an array whose members are single items
|
java.lang.Iterable<GroundedValue<? extends Item>> |
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 pos)
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 subarray given a start and end position
|
java.lang.String |
toShortString()
Provide a short string showing the contents of the item, suitable
for use in error messages
|
atomize, call, deepEquals, effectiveBooleanValue, export, getArity, getDescription, getFunctionItemType, getFunctionName, getMemberType, getStringValue, getStringValueCS, isTrustedResultType, makeNewContext, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetGenre, getMemberTypeargumentArray, call, deepEquals, export, getArity, getDescription, getFunctionItemType, getFunctionName, isTrustedResultType, makeNewContextasArgumentArray, atomize, getLength, getStringValue, getStringValueCS, head, isStreamed, itemAt, iterate, iterator, reduce, subsequenceasIterable, effectiveBooleanValue, materializemakeRepeatablepublic static final SimpleArrayItem EMPTY_ARRAY
public SimpleArrayItem(java.util.List<GroundedValue<? extends Item>> members)
members - the list of values (in general, each value is a sequence) to form the members of the array.
The values must be repeatable sequences (not LazySequences); this is not checked.public static SimpleArrayItem makeSimpleArrayItem(SequenceIterator<? extends Item> input) throws XPathException
input - an iterator over the items to make up the arrayXPathException - if evaluating the SequenceIterator failspublic OperandRole[] getOperandRoles()
getOperandRoles in interface Function<ArrayItem>getOperandRoles in class AbstractArrayItempublic void makeGrounded()
throws XPathException
XPathExceptionpublic boolean isArray()
isArray in interface Function<ArrayItem>isArray in class AbstractArrayItempublic boolean isMap()
isMap in interface Function<ArrayItem>isMap in class AbstractArrayItempublic AnnotationList getAnnotations()
getAnnotations in interface Function<ArrayItem>getAnnotations in class AbstractArrayItempublic GroundedValue get(int index) throws XPathException
get in interface 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
put in interface ArrayItemindex - the position of the member to replace (zero-based)newValue - the replacement valueXPathException - if the index is out of rangepublic int arrayLength()
arrayLength in interface ArrayItempublic boolean isEmpty()
public java.lang.Iterable<GroundedValue<? extends Item>> members()
public ArrayItem removeSeveral(IntSet positions)
removeSeveral in interface ArrayItempositions - the positions of the members to be removed (zero-based).
A value that is out of range is ignored.public ArrayItem remove(int pos)
public ArrayItem subArray(int start, int end)
subArray in interface ArrayItemstart - the start position (zero based)end - the end position (the position of the first item not to be returned)
(zero based)java.lang.IndexOutOfBoundsException - if start, or start+end, is out of rangepublic ArrayItem insert(int position, GroundedValue member)
public java.util.List<GroundedValue<? extends Item>> getMembers()
public java.lang.String toShortString()
toShortString in interface ArrayItemtoShortString in interface Function<ArrayItem>toShortString in interface GroundedValue<ArrayItem>toShortString in interface Item<ArrayItem>Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.