org.norther.tammi.acorn.util
Class CounterIterator

java.lang.Object
  extended by org.norther.tammi.acorn.util.CounterIterator
All Implemented Interfaces:
Iterator

public class CounterIterator
extends Object
implements Iterator

An iterator returning Boolean.TRUE for the specified number of times.

Author:
Ilkka Priha

Constructor Summary
CounterIterator()
          Constructs an endless counter.
CounterIterator(int size)
          Constructs a new counter.
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
           
 void stop()
          Stops the counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterIterator

public CounterIterator()
Constructs an endless counter.


CounterIterator

public CounterIterator(int size)
Constructs a new counter.

Parameters:
size - the size of the counter.
Method Detail

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

stop

public void stop()
Stops the counter.



Copyright © 2004 The Norther Organization. All rights reserved.