com.xml_project.morganaxproc.xdm
Class EmptySequence

java.lang.Object
  extended by com.xml_project.morganaxproc.xdm.XdmSequence
      extended by com.xml_project.morganaxproc.xdm.EmptySequence
All Implemented Interfaces:
Iterable<XdmItem>, Iterator<XdmItem>

public class EmptySequence
extends XdmSequence
implements Iterator<XdmItem>

A singleton class representing an empty sequence. There is no guarantee, all empty sequences will be instances of this class.


Field Summary
static EmptySequence EmptySequence
          The empty sequence.
 
Method Summary
 XdmItem first()
          Returns the first item of this XdmSequence or throws a RuntimeException if sequence is empty.
 XdmItem get(int nr)
           
 boolean hasNext()
           
 XdmItemIterator iterator()
          Returns an iterator over this XdmSequence.
 XdmItem next()
           
 void remove()
          Not implementated for this Iterator
 long size()
          Returns the number of elements in this sequence.
 
Methods inherited from class com.xml_project.morganaxproc.xdm.XdmSequence
atomize, concat, get, getStringValue, hasCommonType, hasValues, isEmpty, normalize, serialize, subSequence, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EmptySequence

public static final EmptySequence EmptySequence
The empty sequence.

Method Detail

get

public XdmItem get(int nr)

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 XdmSequence
Returns:
the number of elements in this sequence.

iterator

public XdmItemIterator iterator()
Description copied from class: XdmSequence
Returns an iterator over this XdmSequence.

Specified by:
iterator in interface Iterable<XdmItem>
Overrides:
iterator in class XdmSequence

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<XdmItem>

next

public XdmItem next()
Specified by:
next in interface Iterator<XdmItem>

remove

public void remove()
Not implementated for this Iterator

Specified by:
remove in interface Iterator<XdmItem>

first

public XdmItem first()
              throws RuntimeException
Description copied from class: XdmSequence
Returns the first item of this XdmSequence or throws a RuntimeException if sequence is empty.

Overrides:
first in class XdmSequence
Returns:
the first item of this sequence.
Throws:
RuntimeException - if the sequence is empty.