01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: /*
17: * $Id: NodeIterator.java,v 1.5 2004/02/16 20:54:58 minchau Exp $
18: */
19:
20: package org.apache.xalan.xsltc;
21:
22: import org.apache.xml.dtm.DTM;
23:
24: /**
25: * @author Jacek Ambroziak
26: * @author Santiago Pericas-Geertsen
27: */
28: public interface NodeIterator extends Cloneable {
29: public static final int END = DTM.NULL;
30:
31: /**
32: * Callers should not call next() after it returns END.
33: */
34: public int next();
35:
36: /**
37: * Resets the iterator to the last start node.
38: */
39: public NodeIterator reset();
40:
41: /**
42: * Returns the number of elements in this iterator.
43: */
44: public int getLast();
45:
46: /**
47: * Returns the position of the current node in the set.
48: */
49: public int getPosition();
50:
51: /**
52: * Remembers the current node for the next call to gotoMark().
53: */
54: public void setMark();
55:
56: /**
57: * Restores the current node remembered by setMark().
58: */
59: public void gotoMark();
60:
61: /**
62: * Set start to END should 'close' the iterator,
63: * i.e. subsequent call to next() should return END.
64: */
65: public NodeIterator setStartNode(int node);
66:
67: /**
68: * True if this iterator has a reversed axis.
69: */
70: public boolean isReverse();
71:
72: /**
73: * Returns a deep copy of this iterator.
74: */
75: public NodeIterator cloneIterator();
76:
77: /**
78: * Prevents or allows iterator restarts.
79: */
80: public void setRestartable(boolean isRestartable);
81:
82: }
|