de.intarsys.tools.collection
Class IntervalIterator
java.lang.Object
de.intarsys.tools.collection.IntervalIterator
- All Implemented Interfaces:
- java.util.Iterator
public class IntervalIterator
- extends java.lang.Object
- implements java.util.Iterator
Implement an Iterator over a virtual collection of numbers defined by an
interval.
The iterator returns every number with (from >.= number) and (number <.=
to) starting with from
. The current number is incremented by
step
after every element access.
Constructor Summary |
IntervalIterator(java.lang.Number from,
java.lang.Number to)
IntervalIterator constructor . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntervalIterator
public IntervalIterator(java.lang.Number from,
java.lang.Number to)
- IntervalIterator constructor .
- Parameters:
from
- The first number to be returned by the iterator.to
- The number defining an upper limit to the numbers in the
collection.
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