org.eclipse.net4j.util.collection
Class LimitedIterator<T>

java.lang.Object
  extended by org.eclipse.net4j.util.collection.AbstractIterator<T>
      extended by org.eclipse.net4j.util.collection.AbstractFilteredIterator<T>
          extended by org.eclipse.net4j.util.collection.LimitedIterator<T>
All Implemented Interfaces:
Iterator<T>

public class LimitedIterator<T>
extends AbstractFilteredIterator<T>

Since:
3.3

Field Summary
 
Fields inherited from class org.eclipse.net4j.util.collection.AbstractIterator
END_OF_DATA
 
Constructor Summary
LimitedIterator(Iterator<T> delegate, int limit)
           
 
Method Summary
 int getCount()
           
 int getLimit()
           
protected  boolean isValid(T element)
           
 
Methods inherited from class org.eclipse.net4j.util.collection.AbstractFilteredIterator
computeNextElement
 
Methods inherited from class org.eclipse.net4j.util.collection.AbstractIterator
hasNext, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedIterator

public LimitedIterator(Iterator<T> delegate,
                       int limit)
Method Detail

getLimit

public final int getLimit()

getCount

public final int getCount()

isValid

protected boolean isValid(T element)
Specified by:
isValid in class AbstractFilteredIterator<T>


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.