com.fasterxml.sort
Class DataReader<T>

java.lang.Object
  extended by com.fasterxml.sort.DataReader<T>
Direct Known Subclasses:
CollectionReader, Merger, RawTextLineReader

public abstract class DataReader<T>
extends Object


Constructor Summary
DataReader()
           
 
Method Summary
abstract  void close()
          Method for closing the reader.
abstract  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.
abstract  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
 

Constructor Detail

DataReader

public DataReader()
Method Detail

readNext

public abstract T readNext()
                    throws IOException
Method for reading the next data item; will return null to indicate end of input, otherwise return a non-null item.

Throws:
IOException

estimateSizeInBytes

public abstract 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.


close

public abstract void close()
                    throws IOException
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.

Throws:
IOException


Copyright © 2011. All Rights Reserved.