com.xml_project.morganaxdm
Class EmptySequence

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

public class EmptySequence
extends XdmSequence
implements java.util.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.morganaxdm.XdmSequence
atomize, concat, get, getStringValue, hasCommonType, hasValues, isEmpty, normalize, serialize, serialize, 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 java.lang.Iterable<XdmItem>
Overrides:
iterator in class XdmSequence

hasNext

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

next

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

remove

public void remove()
Not implementated for this Iterator

Specified by:
remove in interface java.util.Iterator<XdmItem>

first

public XdmItem first()
              throws java.lang.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:
java.lang.RuntimeException - if the sequence is empty.