Class UniqIterator<T>
java.lang.Object
fr.lirmm.graphik.util.stream.UniqIterator<T>
- Type Parameters:
T- the iterated element type
- All Implemented Interfaces:
CloseableIterator<T>, Closeable, AutoCloseable
Remove adjacent equals elements.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an iterator removing adjacent duplicates from a closeable iterator.UniqIterator(Iterator<T> it) Creates an iterator removing adjacent duplicates from a standard iterator. -
Method Summary
-
Constructor Details
-
UniqIterator
-
UniqIterator
Creates an iterator removing adjacent duplicates from a closeable iterator.- Parameters:
it- the iterator to filter
-
-
Method Details
-
hasNext
Description copied from interface:CloseableIteratorReturns whether another element is available.- Specified by:
hasNextin interfaceCloseableIterator<T>- Returns:
- true if another element can be read
- Throws:
IteratorException- if the iteration fails
-
next
Description copied from interface:CloseableIteratorReturns the next element.- Specified by:
nextin interfaceCloseableIterator<T>- Returns:
- the next element
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<T>
-