Modifier and Type | Field and Description |
---|---|
static SimpleArrayItem |
EMPTY_ARRAY |
SINGLE_ARRAY_TYPE
Constructor and Description |
---|
SimpleArrayItem(List<Sequence> members) |
Modifier and Type | Method and Description |
---|---|
AtomicSequence |
atomize()
Atomize the item.
|
Sequence |
call(XPathContext context,
Sequence[] args)
Invoke the array in its role as a function
|
ArrayItem |
concat(ArrayItem other)
Concatenate this array with another
|
boolean |
deepEquals(Function other,
XPathContext context,
AtomicComparer comparer,
int flags)
Test whether this array is deep-equal to another array,
under the rules of the deep-equal function
|
boolean |
effectiveBooleanValue()
Get the effective boolean value of this sequence
|
void |
export(ExpressionPresenter out)
Output information about this function item to the diagnostic explain() output
|
Sequence |
get(int index)
Get a member of the array
|
int |
getArity()
Get the arity of the function
|
String |
getDescription()
Get a description of this function for use in error messages.
|
FunctionItemType |
getFunctionItemType()
Get the item type of the function item
|
StructuredQName |
getFunctionName()
Get the name of the function, or null if it is anonymous
|
List<Sequence> |
getMembers()
Get a list of the members of the array
|
SequenceType |
getMemberType()
Get the lowest common item type of the members of the array
|
OperandRole[] |
getOperandRoles()
Get the roles of the arguments, for the purposes of streaming
|
String |
getStringValue()
Get the value of the item as a string.
|
CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence.
|
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
|
Iterator<Sequence> |
iterator()
Get the list of all members of the array
|
static SimpleArrayItem |
makeSimpleArrayItem(SequenceIterator input) |
ArrayItem |
remove(int index)
Remove a member from the array
|
int |
size()
Get the size of the array
|
String |
toString()
Output a string representation of the array, suitable for diagnostics
|
getLength, head, itemAt, iterate, reduce, subsequence
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLength, head, itemAt, reduce, subsequence
public static final SimpleArrayItem EMPTY_ARRAY
public static SimpleArrayItem makeSimpleArrayItem(SequenceIterator input) throws XPathException
XPathException
public OperandRole[] getOperandRoles()
getOperandRoles
in interface Function
public AtomicSequence atomize() throws XPathException
atomize
in interface Item
XPathException
- if atomization is not allowed for this kind of itempublic boolean isArray()
public boolean isMap()
public Sequence get(int index) throws XPathException
get
in interface ArrayItem
index
- the position of the member to retrieve (zero-based)XPathException
- if the index is out of rangepublic int size()
public boolean isEmpty()
public ArrayItem remove(int index) throws XPathException
remove
in interface ArrayItem
index
- the position of the member to be removed (zero-based)XPathException
- if the index is out of rangepublic SequenceType getMemberType()
getMemberType
in interface ArrayItem
public FunctionItemType getFunctionItemType()
getFunctionItemType
in interface Function
public StructuredQName getFunctionName()
getFunctionName
in interface Function
public String getDescription()
getDescription
in interface Function
public int getArity()
public Sequence call(XPathContext context, Sequence[] args) throws XPathException
call
in interface Callable
call
in interface Function
context
- the XPath dynamic evaluation contextargs
- the actual arguments to be supplied (a single integer)XPathException
- if a dynamic error occurs within the functionpublic boolean deepEquals(Function other, XPathContext context, AtomicComparer comparer, int flags) throws XPathException
deepEquals
in interface Function
other
- the other function itemcontext
- the dynamic evaluation contextcomparer
- the object to perform the comparisonflags
- options for how the comparison is performedXPathException
- if the comparison cannot be performedpublic boolean effectiveBooleanValue() throws XPathException
effectiveBooleanValue
in interface GroundedValue
XPathException
- if the sequence has no effective boolean value (for example a sequence of two integers)public String getStringValue()
getStringValue
in interface GroundedValue
getStringValue
in interface Item
UnsupportedOperationException
- if the item is an array (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValueCS()
public CharSequence getStringValueCS()
getStringValueCS
in interface GroundedValue
getStringValueCS
in interface Item
UnsupportedOperationException
- if the item is an array (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValueCS()
public void export(ExpressionPresenter out)
public List<Sequence> getMembers()
getMembers
in interface ArrayItem
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.