com.xml_project.morganaxdm
Class Array

java.lang.Object
  extended by com.xml_project.morganaxdm.XdmSequence
      extended by com.xml_project.morganaxdm.XdmItem
          extended by com.xml_project.morganaxdm.Array
All Implemented Interfaces:
java.lang.Iterable<XdmItem>

public class Array
extends XdmItem

An array as defined in XDM 3.1 (not usable yet)


Constructor Summary
  Array()
           
protected Array(Array array)
           
  Array(XdmSequence content)
           
  Array(XdmSequence[] content)
           
 
Method Summary
 AtomizingIterator atomize()
          Returns an AtomizingIterator which gives access to the atomized value of the elements in this sequence.
 XdmSequence flatten()
           
static XdmSequence flatten(XdmSequence source)
           
 XdmItem get(long nr)
          Returns the n-th element of the sequence, counting by 1.
 XdmSequence get(XS_AnyAtomicType val)
           
 XdmSequence getEntry(int pos)
           
 java.lang.String getStringValue()
          Returns the string value.
 java.lang.Object getValue()
          Returns the value itself.
static Array insertBefore(Array anArray, int pos, XdmSequence element)
           
 boolean isValue()
          Flags, this item is a value as opposed to a node
static Array join(XdmSequence arrayList)
           
 long length()
          Returns the number of elements in this array
 Array remove(int pos)
           
 Array reverse()
           
 long size()
          Returns the number of elements in this sequence.
 Array sort(com.xml_project.morganaxquery.configuration.Collation collation, XS_dayTimeDuration timeZone)
           
 Array subarray(int start, int length)
           
 java.lang.String toString()
           
 XdmSequence values()
           
 
Methods inherited from class com.xml_project.morganaxdm.XdmItem
first, hasValues, isEmpty, iterator, subSequence
 
Methods inherited from class com.xml_project.morganaxdm.XdmSequence
concat, hasCommonType, normalize, serialize, serialize, serialize, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Array

protected Array(Array array)

Array

public Array()

Array

public Array(XdmSequence content)
      throws XPathException
Throws:
XPathException

Array

public Array(XdmSequence[] content)
Method Detail

isValue

public boolean isValue()
Description copied from class: XdmItem
Flags, this item is a value as opposed to a node

Specified by:
isValue in class XdmItem
Returns:
true, if this item is an XDMValue and not a node()

atomize

public AtomizingIterator atomize()
                          throws XPathException
Description copied from class: XdmSequence
Returns an AtomizingIterator which gives access to the atomized value of the elements in this sequence.

Overrides:
atomize in class XdmItem
Returns:
an AtomizingIterator.
Throws:
XPathException - thrown, if the sequence contains elements which cannot be atomized.

flatten

public static XdmSequence flatten(XdmSequence source)
                           throws XPathException
Throws:
XPathException

flatten

public XdmSequence flatten()
                    throws XPathException
Throws:
XPathException

sort

public Array sort(com.xml_project.morganaxquery.configuration.Collation collation,
                  XS_dayTimeDuration timeZone)
           throws XPathException
Throws:
XPathException

insertBefore

public static Array insertBefore(Array anArray,
                                 int pos,
                                 XdmSequence element)
                          throws XPathException
Throws:
XPathException

join

public static Array join(XdmSequence arrayList)

remove

public Array remove(int pos)
             throws XPathException
Throws:
XPathException

reverse

public Array reverse()

subarray

public Array subarray(int start,
                      int length)
               throws XPathException
Throws:
XPathException

getStringValue

public java.lang.String getStringValue()
Description copied from class: XdmItem
Returns the string value.

Specified by:
getStringValue in class XdmItem
Returns:
the string value.

getValue

public java.lang.Object getValue()
Description copied from class: XdmItem
Returns the value itself.

Specified by:
getValue in class XdmItem
Returns:
the value.

size

public long size()
Description copied from class: XdmSequence
Returns the number of elements in this sequence. Invoking this method will convert the underlying sequence to a materialized sequence which will take time and cost memory. See also get(n).

Overrides:
size in class XdmItem
Returns:
the number of elements in this sequence.

length

public long length()
Returns the number of elements in this array

Returns:
the number of elements

values

public XdmSequence values()
                   throws XPathException
Throws:
XPathException

get

public XdmItem get(long nr)
Description copied from class: XdmSequence
Returns the n-th element of the sequence, counting by 1. Invoking this method will convert the underlying sequence to a materialized sequence which will take time and cost memory. See also size().

Overrides:
get in class XdmItem
Parameters:
nr - the number of the element, based by 1!
Returns:
the element on the given position.

get

public XdmSequence get(XS_AnyAtomicType val)
                throws XPathException
Throws:
XPathException

getEntry

public XdmSequence getEntry(int pos)
                     throws XPathException
Throws:
XPathException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object