All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.saxon.tree.iter.EmptyAxisIterator Maven / Gradle / Ivy

There is a newer version: 10.5
Show newest version
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2013 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

package net.sf.saxon.tree.iter;

import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.pattern.NodeTest;

/**
* An AxisIterator over an empty sequence
*/
public class EmptyAxisIterator
        extends EmptyIterator implements AxisIterator {

    /*@NotNull*/
    private static EmptyAxisIterator theInstance =
            new EmptyAxisIterator();


    public static  net.sf.saxon.tree.iter.EmptyAxisIterator emptyAxisIterator() {
        return (EmptyAxisIterator) theInstance;
    }

    /**
     * Return an iterator over an axis, starting at the current node.
     *
     * @param axis the axis to iterate over, using a constant such as
     *             {@link net.sf.saxon.om.AxisInfo#CHILD}
     * @param test a predicate to apply to the nodes before returning them.
     * @throws NullPointerException if there is no current node
     */
    public AxisIterator iterateAxis(byte axis, NodeTest test) {
        throw new NullPointerException();
    }

    /**
     * Get another iterator over the same items, positioned at the start.
     *
     * @return another iterator over an empty sequence (in practice, it
     *         returns the same iterator each time)
     */
    /*@NotNull*/
    @Override
    public net.sf.saxon.tree.iter.EmptyAxisIterator getAnother() {
        return this;
    }

    /**
     * Move to the next node, without returning it. Returns true if there is
     * a next node, false if the end of the sequence has been reached. After
     * calling this method, the current node may be retrieved using the
     * current() function.
     */

    public boolean moveNext() {
        return false;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy