net.sf.saxon.s9api.XdmEmptySequence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of saxon9 Show documentation
Show all versions of saxon9 Show documentation
Provides a basic XSLT 2.0 and XQuery 1.0 processor (W3C Recommendations,
January 2007). Command line interfaces and implementations of several
Java APIs (DOM, XPath, s9api) are also included.
The newest version!
package net.sf.saxon.s9api;
import net.sf.saxon.value.EmptySequence;
/**
* 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 {@link #getInstance} method.
*
* An empty sequence may also be represented by an {@link 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 {@link XdmItem}, an empty sequence is represented by a
* Java null value.
*/
public class XdmEmptySequence extends XdmValue {
private static XdmEmptySequence THE_INSTANCE = new XdmEmptySequence();
/**
* Return the singleton instance of this class
* @return an XdmValue representing an empty sequence
*/
public static XdmEmptySequence getInstance() {
return THE_INSTANCE;
}
private XdmEmptySequence() {
super(EmptySequence.getInstance());
}
/**
* Get the number of items in the sequence
* @return the number of items in the value - always zero
*/
@Override
public int size() {
return 0;
}
}
//
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
// you may not use this file except in compliance with the License. You may obtain a copy of the
// License at http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
// See the License for the specific language governing rights and limitations under the License.
//
// The Original Code is: all this file
//
// The Initial Developer of the Original Code is Michael H. Kay.
//
// Contributor(s):
//
© 2015 - 2025 Weber Informatics LLC | Privacy Policy