com.fasterxml.sort
Class Merger.PairwiseMerger<T>
java.lang.Object
com.fasterxml.sort.DataReader<T>
com.fasterxml.sort.Merger<T>
com.fasterxml.sort.Merger.PairwiseMerger<T>
- Enclosing class:
- Merger<T>
protected static class Merger.PairwiseMerger<T>
- extends Merger<T>
|
Method Summary |
void |
close()
Method for closing the reader. |
int |
estimateSizeInBytes(T item)
Method that should estimate memory usage of given item, for purpose
of limiting amount of data kept in memory during pre-sorting phase. |
T |
readNext()
Method for reading the next data item; will return
null to indicate end of input, otherwise return a non-null
item. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_reader1
protected final DataReader<T> _reader1
_reader2
protected final DataReader<T> _reader2
_data1
protected T _data1
_data2
protected T _data2
Merger.PairwiseMerger
public Merger.PairwiseMerger(Comparator<T> comparator,
DataReader<T> reader1,
DataReader<T> reader2)
throws IOException
- Throws:
IOException
readNext
public T readNext()
throws IOException
- Description copied from class:
DataReader
- Method for reading the next data item; will return
null to indicate end of input, otherwise return a non-null
item.
- Specified by:
readNext in class DataReader<T>
- Throws:
IOException
estimateSizeInBytes
public int estimateSizeInBytes(T item)
- Description copied from class:
DataReader
- Method that should estimate memory usage of given item, for purpose
of limiting amount of data kept in memory during pre-sorting phase.
- Specified by:
estimateSizeInBytes in class DataReader<T>
close
public void close()
throws IOException
- Description copied from class:
DataReader
- Method for closing the reader. Note that reader needs to ensure
that it is ok to call close multiple times. Reader may also
close underlying resources as soon as it has reached end of input.
- Specified by:
close in class DataReader<T>
- Throws:
IOException
Copyright © 2011. All Rights Reserved.