public final class NonReusingKeyGroupedIterator<E> extends Object implements KeyGroupedIterator<E>
Modifier and Type | Class and Description |
---|---|
class |
NonReusingKeyGroupedIterator.ValuesIterator |
Constructor and Description |
---|
NonReusingKeyGroupedIterator(MutableObjectIterator<E> iterator,
TypeComparator<E> comparator)
Initializes the KeyGroupedIterator.
|
Modifier and Type | Method and Description |
---|---|
TypeComparator<E> |
getComparatorWithCurrentReference() |
E |
getCurrent() |
NonReusingKeyGroupedIterator.ValuesIterator |
getValues()
Returns an iterator over all values that belong to the current key.
|
boolean |
nextKey()
Moves the iterator to the next key.
|
public NonReusingKeyGroupedIterator(MutableObjectIterator<E> iterator, TypeComparator<E> comparator)
iterator
- An iterator over records, which are sorted by the key fields, in any order.comparator
- The comparator for the data type iterated over.public boolean nextKey() throws IOException
getValues()
method. Hence, if called
multiple times it "removes" key groups.nextKey
in interface KeyGroupedIterator<E>
IOException
public E getCurrent()
getCurrent
in interface KeyGroupedIterator<E>
public TypeComparator<E> getComparatorWithCurrentReference()
public NonReusingKeyGroupedIterator.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–2021 The Apache Software Foundation. All rights reserved.