org.gridkit.jvmtool.event
Class MergeIterator<T>
java.lang.Object
org.gridkit.jvmtool.event.MergeIterator<T>
- All Implemented Interfaces:
- Iterator<T>
public class MergeIterator<T>
- extends Object
- implements Iterator<T>
Merges two Iterator into one.
Each of nested Iterators MUST produce ordered, duplicate free
sequence of values.
Result would be ordered, duplicate free sequence of values present
in either iterator.
- Author:
- Alexey Ragozin (alexey.ragozin@gmail.com)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MergeIterator
public MergeIterator(Iterator<T> a,
Iterator<T> b,
Comparator<T> cmp)
merge
public static <T> Iterator<T> merge(Iterator<T> a,
Iterator<T> b)
merge
public static <T> Iterator<T> merge(Iterator<T> a,
Iterator<T> b,
Comparator<T> cmp)
merge
public static <T> Iterable<T> merge(Iterable<T> a,
Iterable<T> b)
merge
public static <T> Iterable<T> merge(Iterable<T> a,
Iterable<T> b,
Comparator<T> cmp)
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface Iterator<T>
next
public T next()
- Specified by:
next in interface Iterator<T>
remove
public void remove()
- Specified by:
remove in interface Iterator<T>
Copyright © 2019. All Rights Reserved.