1. /*
  2. * Copyright 2001-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: NodeIterator.java,v 1.5 2004/02/16 20:54:58 minchau Exp $
  18. */
  19. package com.sun.org.apache.xalan.internal.xsltc;
  20. import com.sun.org.apache.xml.internal.dtm.DTM;
  21. /**
  22. * @author Jacek Ambroziak
  23. * @author Santiago Pericas-Geertsen
  24. */
  25. public interface NodeIterator extends Cloneable {
  26. public static final int END = DTM.NULL;
  27. /**
  28. * Callers should not call next() after it returns END.
  29. */
  30. public int next();
  31. /**
  32. * Resets the iterator to the last start node.
  33. */
  34. public NodeIterator reset();
  35. /**
  36. * Returns the number of elements in this iterator.
  37. */
  38. public int getLast();
  39. /**
  40. * Returns the position of the current node in the set.
  41. */
  42. public int getPosition();
  43. /**
  44. * Remembers the current node for the next call to gotoMark().
  45. */
  46. public void setMark();
  47. /**
  48. * Restores the current node remembered by setMark().
  49. */
  50. public void gotoMark();
  51. /**
  52. * Set start to END should 'close' the iterator,
  53. * i.e. subsequent call to next() should return END.
  54. */
  55. public NodeIterator setStartNode(int node);
  56. /**
  57. * True if this iterator has a reversed axis.
  58. */
  59. public boolean isReverse();
  60. /**
  61. * Returns a deep copy of this iterator.
  62. */
  63. public NodeIterator cloneIterator();
  64. /**
  65. * Prevents or allows iterator restarts.
  66. */
  67. public void setRestartable(boolean isRestartable);
  68. }