Package org.HdrHistogram
Class HistogramLogScanner
- java.lang.Object
-
- org.HdrHistogram.HistogramLogScanner
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HistogramLogScanner extends Object implements Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHistogramLogScanner.EncodableHistogramSupplierstatic interfaceHistogramLogScanner.EventHandlerHandles log events, return true to stop processing.
-
Constructor Summary
Constructors Constructor Description HistogramLogScanner(File inputFile)Constructs a new HistogramLogReader that produces intervals read from the specified file.HistogramLogScanner(InputStream inputStream)Constructs a new HistogramLogReader that produces intervals read from the specified InputStream.HistogramLogScanner(String inputFileName)Constructs a new HistogramLogReader that produces intervals read from the specified file name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close underlying scanner.booleanhasNextLine()Indicates whether or not additional intervals may exist in the logvoidprocess(HistogramLogScanner.EventHandler handler)
-
-
-
Field Detail
-
scanner
protected final Scanner scanner
-
-
Constructor Detail
-
HistogramLogScanner
public HistogramLogScanner(String inputFileName) throws FileNotFoundException
Constructs a new HistogramLogReader that produces intervals read from the specified file name.- Parameters:
inputFileName- The name of the file to read from- Throws:
FileNotFoundException- when unable to find inputFileName
-
HistogramLogScanner
public HistogramLogScanner(InputStream inputStream)
Constructs a new HistogramLogReader that produces intervals read from the specified InputStream. Note that log readers constructed through this constructor do not assume ownership of stream and will not close it onclose().- Parameters:
inputStream- The InputStream to read from
-
HistogramLogScanner
public HistogramLogScanner(File inputFile) throws FileNotFoundException
Constructs a new HistogramLogReader that produces intervals read from the specified file.- Parameters:
inputFile- The File to read from- Throws:
FileNotFoundException- when unable to find inputFile
-
-
Method Detail
-
close
public void close()
Close underlying scanner.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
process
public void process(HistogramLogScanner.EventHandler handler)
-
hasNextLine
public boolean hasNextLine()
Indicates whether or not additional intervals may exist in the log- Returns:
- true if additional intervals may exist in the log
-
-