it.unimi.dsi.fastutil.doubles
Class AbstractDoubleIterator

java.lang.Object
  extended byit.unimi.dsi.fastutil.doubles.AbstractDoubleIterator
All Implemented Interfaces:
DoubleIterator, Iterator
Direct Known Subclasses:
AbstractDoubleBidirectionalIterator

public abstract class AbstractDoubleIterator
extends Object
implements DoubleIterator

An abstract class facilitating the creation of type-specific iterators.

To create a type-specific iterator you need both a method returning the next element as primitive type and a method returning the next element as an object. However, if you inherit from this class you need just one (anyone). Moreover, remove() will throw an UnsupportedOperationException.

This class implements also a trivial version of skip().

See Also:
Iterator

Method Summary
 Object next()
          This method just invokes the type-specific version.
 double nextDouble()
          This method just invokes the generic version.
 void remove()
          This method just throws an UnsupportedOperationException.
 int skip(int n)
          This method just iterates Iterator.next() for at most n times, stopping if Iterator.hasNext() becomes false.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
hasNext
 

Method Detail

nextDouble

public double nextDouble()
This method just invokes the generic version.

Specified by:
nextDouble in interface DoubleIterator
Returns:
the next element from the collection.
See Also:
Iterator.next()

next

public Object next()
This method just invokes the type-specific version.

Specified by:
next in interface Iterator

remove

public void remove()
This method just throws an UnsupportedOperationException.

Specified by:
remove in interface Iterator

skip

public int skip(int n)
This method just iterates Iterator.next() for at most n times, stopping if Iterator.hasNext() becomes false.

Specified by:
skip in interface DoubleIterator
Parameters:
n - the number of elements to skip.
Returns:
the number of elements actually skipped.
See Also:
Iterator.next()