001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements. See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership. The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the  "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *     http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    /*
019     * $Id: NodeIterator.java 468648 2006-10-28 07:00:06Z minchau $
020     */
021    
022    package org.apache.xalan.xsltc;
023    
024    import org.apache.xml.dtm.DTM;
025    
026    /**
027     * @author Jacek Ambroziak
028     * @author Santiago Pericas-Geertsen
029     */
030    public interface NodeIterator extends Cloneable {
031        public static final int END = DTM.NULL;
032    
033        /** 
034         * Callers should not call next() after it returns END.
035         */
036        public int next();
037    
038        /**
039         * Resets the iterator to the last start node.
040         */
041        public NodeIterator reset();
042    
043        /**
044         * Returns the number of elements in this iterator.
045         */
046        public int getLast();
047    
048        /**
049         * Returns the position of the current node in the set.
050         */
051        public int getPosition();
052    
053        /**
054         * Remembers the current node for the next call to gotoMark().
055         */
056        public void setMark();
057    
058        /**
059         * Restores the current node remembered by setMark().
060         */
061        public void gotoMark();
062    
063        /** 
064         * Set start to END should 'close' the iterator, 
065         * i.e. subsequent call to next() should return END.
066         */
067        public NodeIterator setStartNode(int node);
068    
069        /**
070         * True if this iterator has a reversed axis.
071         */
072        public boolean isReverse();
073    
074        /**
075         * Returns a deep copy of this iterator.
076         */
077        public NodeIterator cloneIterator();
078    
079        /**
080         * Prevents or allows iterator restarts.
081         */
082        public void setRestartable(boolean isRestartable);
083    
084    }