com.fasterxml.sort
Class Merger.PairwiseMerger<T>

java.lang.Object
  extended by com.fasterxml.sort.DataReader<T>
      extended by com.fasterxml.sort.Merger<T>
          extended by com.fasterxml.sort.Merger.PairwiseMerger<T>
Enclosing class:
Merger<T>

protected static class Merger.PairwiseMerger<T>
extends Merger<T>


Nested Class Summary
 
Nested classes/interfaces inherited from class com.fasterxml.sort.Merger
Merger.PairwiseMerger<T>
 
Field Summary
protected  T _data1
           
protected  T _data2
           
protected  DataReader<T> _reader1
           
protected  DataReader<T> _reader2
           
 
Fields inherited from class com.fasterxml.sort.Merger
_comparator
 
Constructor Summary
Merger.PairwiseMerger(Comparator<T> comparator, DataReader<T> reader1, DataReader<T> reader2)
           
 
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 com.fasterxml.sort.Merger
mergedReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_reader1

protected final DataReader<T> _reader1

_reader2

protected final DataReader<T> _reader2

_data1

protected T _data1

_data2

protected T _data2
Constructor Detail

Merger.PairwiseMerger

public Merger.PairwiseMerger(Comparator<T> comparator,
                             DataReader<T> reader1,
                             DataReader<T> reader2)
                      throws IOException
Throws:
IOException
Method Detail

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.