01: /*
02: * Copyright 1999-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: EmptyIterator.java,v 1.2 2004/02/16 23:06:11 minchau Exp $
18: */
19: package org.apache.xml.dtm.ref;
20:
21: import org.apache.xml.dtm.DTMAxisIterator;
22: import org.apache.xml.dtm.DTM;
23:
24: /**
25: * DTM Empty Axis Iterator. The class is immutable
26: */
27: public final class EmptyIterator implements DTMAxisIterator {
28: private static final EmptyIterator INSTANCE = new EmptyIterator();
29:
30: public static DTMAxisIterator getInstance() {
31: return INSTANCE;
32: }
33:
34: private EmptyIterator() {
35: }
36:
37: public final int next() {
38: return END;
39: }
40:
41: public final DTMAxisIterator reset() {
42: return this ;
43: }
44:
45: public final int getLast() {
46: return 0;
47: }
48:
49: public final int getPosition() {
50: return 1;
51: }
52:
53: public final void setMark() {
54: }
55:
56: public final void gotoMark() {
57: }
58:
59: public final DTMAxisIterator setStartNode(int node) {
60: return this ;
61: }
62:
63: public final int getStartNode() {
64: return END;
65: }
66:
67: public final boolean isReverse() {
68: return false;
69: }
70:
71: public final DTMAxisIterator cloneIterator() {
72: return this ;
73: }
74:
75: public final void setRestartable(boolean isRestartable) {
76: }
77:
78: public final int getNodeByPosition(int position) {
79: return END;
80: }
81: }
|