public class XdmArray extends XdmFunctionItem
An XdmArray is immutable.
| Constructor and Description |
|---|
XdmArray()
Create an empty XdmArray
|
XdmArray(ArrayItem array)
Create an XdmArray that wraps a supplied ArrayItem
|
XdmArray(java.lang.Iterable<? extends XdmValue> members)
Create an XdmArray supplying the members as a collection of XdmValue objects
|
XdmArray(XdmValue[] members)
Create an XdmArray supplying the members as an array of XdmValue objects
|
| Modifier and Type | Method and Description |
|---|---|
int |
arrayLength()
Get the number of members in the array
|
java.util.List<XdmValue> |
asList()
Get the members of the array in the form of a list.
|
XdmValue |
get(int n)
Get the n'th member in the array, counting from zero.
|
ArrayItem |
getUnderlyingValue()
Get the underlying implementation object representing the value.
|
static XdmArray |
makeArray(boolean[] input)
Make an XdmArray whose members are xs:boolean values
|
static XdmArray |
makeArray(byte[] input)
Make an XdmArray whose members are xs:integer values
|
static XdmArray |
makeArray(int[] input)
Make an XdmArray whose members are xs:integer values
|
static XdmArray |
makeArray(long[] input)
Make an XdmArray whose members are xs:long values
|
static XdmArray |
makeArray(java.lang.Object[] input)
Make an XDM array from a Java array.
|
static XdmArray |
makeArray(short[] input)
Make an XdmArray whose members are xs:integer values
|
XdmArray |
put(int n,
XdmValue value)
Create a new array in which one member is replaced with a new value.
|
call, getArity, getName, getSystemFunction, isAtomicValueasMap, getStringValue, size, wrapItemappend, itemAt, iterator, makeSequence, makeValue, setValue, toString, wrappublic XdmArray()
public XdmArray(ArrayItem array)
array - the ArrayItem to be encapsulatedpublic XdmArray(XdmValue[] members)
members - an array of XdmValue objects. Note that subsequent changes to the array will have no effect
on the XdmValue.public XdmArray(java.lang.Iterable<? extends XdmValue> members)
members - a sequence of XdmValue objects. Note that if this is supplied as a list or similar
collection, subsequent changes to the list/collection will have no effect on the XdmValue.
Note that the argument can be a single XdmValue representing a sequence, in which case the
constructed array will have one member for each item in the supplied sequence.public int arrayLength()
XdmItem.size() method returns 1 (one),
because an XDM array is an item.)public XdmValue get(int n) throws java.lang.IndexOutOfBoundsException
n - the member that is required, counting the first member in the array as member zerojava.lang.IndexOutOfBoundsException - if n is less than zero or greater than or equal to the number
of members in the arraypublic XdmArray put(int n, XdmValue value) throws java.lang.IndexOutOfBoundsException
n - the position of the member that is to be replaced, counting the first member
in the array as member zerovalue - the new value for this memberjava.lang.IndexOutOfBoundsException - if n is less than zero or greater than or equal to the number
of members in the arraypublic java.util.List<XdmValue> asList()
public ArrayItem getUnderlyingValue()
getUnderlyingValue in class XdmItempublic static XdmArray makeArray(java.lang.Object[] input) throws java.lang.IllegalArgumentException
XdmValue.makeValue(Object)java.lang.IllegalArgumentException - if conversion is not possiblepublic static XdmArray makeArray(boolean[] input)
input - the input array of booleanspublic static XdmArray makeArray(long[] input)
input - the input array of integerspublic static XdmArray makeArray(int[] input)
input - the input array of integerspublic static XdmArray makeArray(short[] input)
input - the input array of integerspublic static XdmArray makeArray(byte[] input)
input - the input array of integersCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.