Package net.sf.saxon.s9api

## Class XdmEmptySequence

- java.lang.Object
- - net.sf.saxon.s9api.XdmValue
  - - net.sf.saxon.s9api.XdmEmptySequence

- All Implemented Interfaces:
    `java.lang.Iterable<XdmItem>`

      public class XdmEmptySequence
      extends XdmValue

  The class `XdmEmptySequence` represents an empty sequence in the XDM Data Model.

  This is a singleton class: there is only one instance, which may be obtained using the `getInstance()` method.

  An empty sequence may also be represented by an `XdmValue` whose length happens to be zero. Applications should therefore not test to see whether an object is an instance of this class in order to decide whether it is empty.

  Note: in interfaces that expect an `XdmItem`, an empty sequence is represented by a Java null value.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static XdmEmptySequence` | `getInstance()` | Return the singleton instance of this class
    `int` | `size()` | Get the number of items in the sequence

    - ### Methods inherited from class net.sf.saxon.s9api.XdmValue

      `append, documentOrder, fromGroundedValue, getUnderlyingValue, isEmpty, itemAt, iterator, makeSequence, makeValue, select, setValue, stream, toString, wrap, wrap`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Method Detail

    - #### getInstance

          public static XdmEmptySequence getInstance()

      Return the singleton instance of this class
      Returns:
        an XdmValue representing an empty sequence

    - #### size

          public int size()

      Get the number of items in the sequence
      Overrides:
        `size` in class `XdmValue`
      Returns:
        the number of items in the value - always zero