de.intarsys.tools.collection
Class IntervalIterator
java.lang.Object
de.intarsys.tools.collection.IntervalIterator
- All Implemented Interfaces:
- Iterator
public class IntervalIterator
- extends Object
- implements 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.
IntervalIterator
public IntervalIterator(Number from,
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 Iterator
next
public Object next()
- Specified by:
next in interface Iterator
remove
public void remove()
- Specified by:
remove in interface Iterator
Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.