KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > dtm > ref > EmptyIterator


1
2 /*
3  * Copyright 1999-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 /*
18  * $Id: EmptyIterator.java,v 1.2 2004/02/16 23:06:11 minchau Exp $
19  */

20 package com.sun.org.apache.xml.internal.dtm.ref;
21
22 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
23 import com.sun.org.apache.xml.internal.dtm.DTM;
24
25
26 /**
27  * DTM Empty Axis Iterator. The class is immutable
28  */

29 public final class EmptyIterator implements DTMAxisIterator
30 {
31   private static final EmptyIterator INSTANCE = new EmptyIterator();
32   
33   public static DTMAxisIterator getInstance() {return INSTANCE;}
34   
35   private EmptyIterator(){}
36   
37   public final int next(){ return END; }
38   
39   public final DTMAxisIterator reset(){ return this; }
40
41   public final int getLast(){ return 0; }
42
43   public final int getPosition(){ return 1; }
44
45   public final void setMark(){}
46
47   public final void gotoMark(){}
48
49   public final DTMAxisIterator setStartNode(int node){ return this; }
50
51   public final int getStartNode(){ return END; }
52   
53   public final boolean isReverse(){return false;}
54   
55   public final DTMAxisIterator cloneIterator(){ return this; }
56   
57   public final void setRestartable(boolean isRestartable) {}
58   
59   public final int getNodeByPosition(int position){ return END; }
60 }
61
Popular Tags