xxl.cursors
Class Dropper

java.lang.Object
  |
  +--xxl.cursors.Dropper

public class Dropper
extends java.lang.Object
implements Cursor

The Dropper drops/swallows elements until/as long as the given Function returns Boolean.TRUE. The remaining elements of the input Iterator are returned.


Field Summary
protected  boolean asLongAs
           
protected  Cursor cursor
           
protected  Function function
           
protected  boolean got
           
protected  int index
           
protected  boolean skipped
           
 
Constructor Summary
Dropper(Cursor cursor, Function function, boolean asLongAs)
           
Dropper(java.util.Iterator iterator, Function function, boolean asLongAs)
           
Dropper(java.util.Iterator iterator, int number)
           
Dropper(PeekIterator peekIterator, Function function, boolean asLongAs)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 java.lang.Object peek()
           
 void remove()
           
 void reset()
           
 boolean supportsPeek()
           
 void update(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cursor

protected Cursor cursor

skipped

protected boolean skipped

got

protected boolean got

index

protected int index

function

protected Function function

asLongAs

protected boolean asLongAs
Constructor Detail

Dropper

public Dropper(Cursor cursor,
               Function function,
               boolean asLongAs)

Dropper

public Dropper(PeekIterator peekIterator,
               Function function,
               boolean asLongAs)

Dropper

public Dropper(java.util.Iterator iterator,
               Function function,
               boolean asLongAs)

Dropper

public Dropper(java.util.Iterator iterator,
               int number)
Method Detail

close

public void close()
Specified by:
close in interface Cursor

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Cursor

next

public java.lang.Object next()
                      throws java.lang.UnsupportedOperationException
Specified by:
next in interface Cursor

peek

public java.lang.Object peek()
                      throws java.lang.UnsupportedOperationException
Specified by:
peek in interface Cursor

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Specified by:
remove in interface Cursor

reset

public void reset()
           throws java.lang.UnsupportedOperationException
Specified by:
reset in interface Cursor

supportsPeek

public boolean supportsPeek()
Specified by:
supportsPeek in interface Cursor

update

public void update(java.lang.Object object)
            throws java.lang.UnsupportedOperationException
Specified by:
update in interface Cursor