org.expasy.jpl.commons.collection
Class ExtraIterable.AbstractExtraIterator<T>

java.lang.Object
  extended by org.expasy.jpl.commons.collection.ExtraIterable.AbstractExtraIterator<T>
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
IndexIterable.Iterator
Enclosing interface:
ExtraIterable<T>

public abstract static class ExtraIterable.AbstractExtraIterator<T>
extends Object
implements Iterator<T>

Abstract inner class with default implementation of nextToList methods.
hasNext() and next() will have to be implemented.


Constructor Summary
ExtraIterable.AbstractExtraIterator()
           
 
Method Summary
 List<T> nextToList()
          Returns all elements into a list.
 List<T> nextToList(int nValues)
          Return a list with the next elements up to nValues.
 void remove()
          remove is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
hasNext, next
 

Constructor Detail

ExtraIterable.AbstractExtraIterator

public ExtraIterable.AbstractExtraIterator()
Method Detail

remove

public void remove()
remove is not supported.

Specified by:
remove in interface Iterator<T>

nextToList

public List<T> nextToList(int nValues)
Return a list with the next elements up to nValues. The number of element in the list can be lower than nValues if there is no more element to return.

Parameters:
nValues - the max number of elements to return.
Returns:
a list with the next elements.

nextToList

public List<T> nextToList()
Returns all elements into a list.

Returns:
a list with all the next elements up to the end.


Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.