1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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 com.sun.org.apache.xml.internal.dtm.ref;
  20. import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
  21. import com.sun.org.apache.xml.internal.dtm.DTM;
  22. /**
  23. * DTM Empty Axis Iterator. The class is immutable
  24. */
  25. public final class EmptyIterator implements DTMAxisIterator
  26. {
  27. private static final EmptyIterator INSTANCE = new EmptyIterator();
  28. public static DTMAxisIterator getInstance() {return INSTANCE;}
  29. private EmptyIterator(){}
  30. public final int next(){ return END; }
  31. public final DTMAxisIterator reset(){ return this; }
  32. public final int getLast(){ return 0; }
  33. public final int getPosition(){ return 1; }
  34. public final void setMark(){}
  35. public final void gotoMark(){}
  36. public final DTMAxisIterator setStartNode(int node){ return this; }
  37. public final int getStartNode(){ return END; }
  38. public final boolean isReverse(){return false;}
  39. public final DTMAxisIterator cloneIterator(){ return this; }
  40. public final void setRestartable(boolean isRestartable) {}
  41. public final int getNodeByPosition(int position){ return END; }
  42. }