|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--xxl.cursors.HashGrouper
A HashGrouper partitions input data into groups (strict evaluation). A HashGrouper calls next() on the input-Cursor until hasNext() returns false. This means that the HashGrouper partitions the data physically. 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
|
protected Function |
function
The Function used to compare two elements. |
protected Cursor |
groups
A Cursor pointing to the resulting groups. |
| Constructor Summary | |
HashGrouper(Cursor cursor,
Function function)
Creates a HashGrouper. |
|
HashGrouper(java.util.Iterator iterator)
Creates a HashGrouper. |
|
HashGrouper(java.util.Iterator iterator,
Function function)
Creates a HashGrouper. |
|
HashGrouper(PeekIterator peekIterator,
Function function)
Creates a HashGrouper. |
|
| Method Summary | |
void |
close()
Closes the Cursor. |
boolean |
hasNext()
Returns true if the iteration has more elements. |
protected void |
init()
Initializes the HashGrouper. |
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 groups
protected Cursor cursor
protected Function function
| Constructor Detail |
public HashGrouper(Cursor cursor,
Function function)
cursor - the Cursor to be wrappedfunction - the Function used to compare two elements
public HashGrouper(java.util.Iterator iterator,
Function function)
iterator - the Iterator to be wrappedfunction - the Function used to compare two elements
public HashGrouper(PeekIterator peekIterator,
Function function)
peekIterator - the PeekIterator to be wrappedfunction - the Function used to compare two elementspublic HashGrouper(java.util.Iterator iterator)
iterator - the Iterator to be wrapped| Method Detail |
protected void init()
public void close()
throws java.util.NoSuchElementException
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 | ||||||||