public final class ReusingKeyGroupedIterator<E> extends Object implements KeyGroupedIterator<E>
Modifier and Type | Class and Description |
---|---|
class |
ReusingKeyGroupedIterator.ValuesIterator |
Constructor and Description |
---|
ReusingKeyGroupedIterator(MutableObjectIterator<E> iterator,
TypeSerializer<E> serializer,
TypeComparator<E> comparator)
Initializes the KeyGroupedIterator.
|
Modifier and Type | Method and Description |
---|---|
TypeComparator<E> |
getComparatorWithCurrentReference() |
E |
getCurrent() |
ReusingKeyGroupedIterator.ValuesIterator |
getValues()
Returns an iterator over all values that belong to the current key.
|
boolean |
nextKey()
Moves the iterator to the next key.
|
public ReusingKeyGroupedIterator(MutableObjectIterator<E> iterator, TypeSerializer<E> serializer, TypeComparator<E> comparator)
iterator
- An iterator over records, which are sorted by the key fields, in any order.serializer
- The serializer for the data type iterated over.comparator
- The comparator for the data type iterated over.public boolean nextKey() throws IOException
getValues()
method. Hence, if called
multiple times it "removes" pairs.nextKey
in interface KeyGroupedIterator<E>
IOException
public TypeComparator<E> getComparatorWithCurrentReference()
public E getCurrent()
getCurrent
in interface KeyGroupedIterator<E>
public ReusingKeyGroupedIterator.ValuesIterator getValues()
null
(before the first call to nextKey()
and after all keys are
consumed. In general, this method returns always a non-null value, if a previous call to
nextKey()
return true
.getValues
in interface KeyGroupedIterator<E>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.