org.tigris.scarab.util
Class SubsetIterator

java.lang.Object
  extended byorg.tigris.scarab.util.SubsetIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
EmptySubsetIterator, SubsetIteratorWithSize

public class SubsetIterator
extends java.lang.Object
implements java.util.Iterator


Field Summary
static SubsetIterator EMPTY
           
(package private)  boolean firstCall
           
 
Constructor Summary
SubsetIterator(java.util.Iterator i, int offset)
          Constructs an itarator on a subset of the given iterator.
SubsetIterator(java.util.Iterator i, int offset, int elements)
          Constructs an itarator on a subset of the given iterator.
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final SubsetIterator EMPTY

firstCall

boolean firstCall
Constructor Detail

SubsetIterator

public SubsetIterator(java.util.Iterator i,
                      int offset,
                      int elements)
Constructs an itarator on a subset of the given iterator. The SubsetIterator starts with the offset-element and iterates over elements elements

Parameters:
i - the Iterator to subset
offset - the position of the first element of the subset

SubsetIterator

public SubsetIterator(java.util.Iterator i,
                      int offset)
Constructs an itarator on a subset of the given iterator. The SubsetIterator starts with the offset-element and iterates over all elements

Parameters:
i - the Iterator to subset
offset - the position of the first element of the subset
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator


Copyright © 2000-2004 Tigris.org. All Rights Reserved.