|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--xxl.cursors.Grouper
A Grouper partitions input data into groups (lazy evaluation). A binary Function is used to compare the actual with the last element. If the Function returns true a new group starts. A call to next() returns a Cursor pointing to the next group.
| Field Summary | |
protected Cursor |
cursor
The Cursor to be wrapped. |
protected Function |
function
The Function used to compare two elements. |
protected int |
groupSize
The actual size of the group. |
protected boolean |
hasPeeked
|
protected java.lang.Object |
prePrevious
The Object seen before the actual Object. |
protected java.lang.Object |
previous
The Object seen before the actual Object. |
protected boolean |
updatePossible
|
| Constructor Summary | |
Grouper(Cursor cursor,
Function function)
Creates a new Grouper. |
|
Grouper(java.util.Iterator iterator,
Function function)
Creates a new Grouper. |
|
Grouper(PeekIterator peekIterator,
Function function)
Creates a new Grouper. |
|
| Method Summary | |
void |
close()
Closes the Cursor. |
boolean |
hasNext()
Returns true if the iteration has more elements. |
java.lang.Object |
next()
Returns the next element in the iteration. |
java.lang.Object |
peek()
Shows the next element in the iteration without removing it. |
void |
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). |
void |
reset()
Resets the Cursor to its initial state. |
boolean |
supportsPeek()
Returns true if the peek operation is supported by this PeekIterator (Always returns false). |
void |
update(java.lang.Object object)
Replaces the object that was returned by the last call to next() or peek(). |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Cursor cursor
protected Function function
protected java.lang.Object previous
protected java.lang.Object prePrevious
protected int groupSize
protected boolean hasPeeked
protected boolean updatePossible
| Constructor Detail |
public Grouper(Cursor cursor,
Function function)
cursor - the Cursor to be wrappedfunction - the Function used to compare two elements
public Grouper(java.util.Iterator iterator,
Function function)
iterator - the iterator to be wrappedfunction - the Function used to compare two elements
public Grouper(PeekIterator peekIterator,
Function function)
peekIterator - the PeekIterator to be wrappedfunction - the Function used to compare two elements| Method Detail |
public void close()
public boolean hasNext()
public java.lang.Object next()
throws java.util.NoSuchElementException
public java.lang.Object peek()
throws java.lang.UnsupportedOperationException
public void remove()
throws java.lang.UnsupportedOperationException
public void reset()
throws java.lang.UnsupportedOperationException
public boolean supportsPeek()
public void update(java.lang.Object object)
throws java.lang.UnsupportedOperationException
object - the object that replaces the object returned
by the last call to next() or peek()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||