1/* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5/* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 23package com.sun.org.apache.xml.internal.dtm.ref; 24 25import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; 26import com.sun.org.apache.xml.internal.dtm.DTM; 27 28 29/** 30 * DTM Empty Axis Iterator. The class is immutable 31 */ 32public final class EmptyIterator implements DTMAxisIterator 33{ 34 private static final EmptyIterator INSTANCE = new EmptyIterator(); 35 36 public static DTMAxisIterator getInstance() {return INSTANCE;} 37 38 private EmptyIterator(){} 39 40 public final int next(){ return END; } 41 42 public final DTMAxisIterator reset(){ return this; } 43 44 public final int getLast(){ return 0; } 45 46 public final int getPosition(){ return 1; } 47 48 public final void setMark(){} 49 50 public final void gotoMark(){} 51 52 public final DTMAxisIterator setStartNode(int node){ return this; } 53 54 public final int getStartNode(){ return END; } 55 56 public final boolean isReverse(){return false;} 57 58 public final DTMAxisIterator cloneIterator(){ return this; } 59 60 public final void setRestartable(boolean isRestartable) {} 61 62 public final int getNodeByPosition(int position){ return END; } 63} 64