PriorityStreamIterator<T extends Comparable<Object>> constructor

PriorityStreamIterator<T extends Comparable<Object>>(
  1. Stream<T> stream, [
  2. int comparison(
    1. T a,
    2. T b
    )?
])

Create a PriorityStreamIterator on stream with an optional comparison function. If comparison is not provided, T must implement Comparable

Implementation

PriorityStreamIterator(Stream<T> stream, [int comparison(T a, T b)?])
    : _iterator = StreamIterator(stream),
      _queue = _StablePriorityQueue<T>(comparison) {
  _accumulateValues();
}