001 002 /* 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 /* 020 * $Id: EmptyIterator.java 468653 2006-10-28 07:07:05Z minchau $ 021 */ 022 package org.apache.xml.dtm.ref; 023 024 import org.apache.xml.dtm.DTMAxisIterator; 025 import org.apache.xml.dtm.DTM; 026 027 028 /** 029 * DTM Empty Axis Iterator. The class is immutable 030 */ 031 public final class EmptyIterator implements DTMAxisIterator 032 { 033 private static final EmptyIterator INSTANCE = new EmptyIterator(); 034 035 public static DTMAxisIterator getInstance() {return INSTANCE;} 036 037 private EmptyIterator(){} 038 039 public final int next(){ return END; } 040 041 public final DTMAxisIterator reset(){ return this; } 042 043 public final int getLast(){ return 0; } 044 045 public final int getPosition(){ return 1; } 046 047 public final void setMark(){} 048 049 public final void gotoMark(){} 050 051 public final DTMAxisIterator setStartNode(int node){ return this; } 052 053 public final int getStartNode(){ return END; } 054 055 public final boolean isReverse(){return false;} 056 057 public final DTMAxisIterator cloneIterator(){ return this; } 058 059 public final void setRestartable(boolean isRestartable) {} 060 061 public final int getNodeByPosition(int position){ return END; } 062 }