|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.tacos.util.SizeRestrictingIterator
public class SizeRestrictingIterator
This class implements an Iterator which can only return a fixed number of items.
| Constructor Summary | |
|---|---|
SizeRestrictingIterator(Iterator iterator)
Constructs an Iterator which will return at most 20 items. |
|
SizeRestrictingIterator(Iterator iter,
int size)
Constructs an Iterator which will return at most as many items as defined by the user. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
|
Object |
next()
|
void |
remove()
|
void |
setMaxSize(int size)
Set the max number of elements this iterator can return |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SizeRestrictingIterator(Iterator iterator)
iterator - The 'real' iterator
public SizeRestrictingIterator(Iterator iter,
int size)
iter - The 'real' iteratorsize - How many items to return| Method Detail |
|---|
public void setMaxSize(int size)
public boolean hasNext()
hasNext in interface Iteratorpublic Object next()
next in interface Iteratorpublic void remove()
remove in interface Iterator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||