Class ListKeyGroupedIterator<E>
- java.lang.Object
-
- org.apache.flink.api.common.operators.util.ListKeyGroupedIterator<E>
-
@Internal public final class ListKeyGroupedIterator<E> extends Object
The KeyValueIterator returns a key and all values that belong to the key (share the same key).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classListKeyGroupedIterator.ValuesIterator
-
Constructor Summary
Constructors Constructor Description ListKeyGroupedIterator(List<E> input, TypeSerializer<E> serializer, TypeComparator<E> comparator)Initializes the ListKeyGroupedIterator..
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListKeyGroupedIterator.ValuesIteratorgetValues()Returns an iterator over all values that belong to the current key.booleannextKey()Moves the iterator to the next key.
-
-
-
Constructor Detail
-
ListKeyGroupedIterator
public ListKeyGroupedIterator(List<E> input, TypeSerializer<E> serializer, TypeComparator<E> comparator)
Initializes the ListKeyGroupedIterator..- Parameters:
input- The list with the input elements.comparator- The comparator for the data type iterated over.
-
-
Method Detail
-
nextKey
public boolean nextKey() throws IOExceptionMoves the iterator to the next key. This method may skip any values that have not yet been returned by the iterator created by thegetValues()method. Hence, if called multiple times it "removes" key groups.- Returns:
- true, if the input iterator has an other group of records with the same key.
- Throws:
IOException
-
getValues
public ListKeyGroupedIterator.ValuesIterator getValues()
Returns an iterator over all values that belong to the current key. The iterator is initiallynull(before the first call tonextKey()and after all keys are consumed. In general, this method returns always a non-null value, if a previous call tonextKey()returntrue.- Returns:
- Iterator over all values that belong to the current key.
-
-