Package org.HdrHistogram
Class HistogramLogScanner
- java.lang.Object
-
- org.HdrHistogram.HistogramLogScanner
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class HistogramLogScanner extends java.lang.Object implements java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HistogramLogScanner.EncodableHistogramSupplier
static interface
HistogramLogScanner.EventHandler
Handles log events, return true to stop processing.private static class
HistogramLogScanner.LazyHistogramReader
-
Field Summary
Fields Modifier and Type Field Description private HistogramLogScanner.LazyHistogramReader
lazyReader
protected java.util.Scanner
scanner
-
Constructor Summary
Constructors Modifier Constructor Description HistogramLogScanner(java.io.File inputFile)
Constructs a new HistogramLogReader that produces intervals read from the specified file.HistogramLogScanner(java.io.InputStream inputStream)
Constructs a new HistogramLogReader that produces intervals read from the specified InputStream.HistogramLogScanner(java.lang.String inputFileName)
Constructs a new HistogramLogReader that produces intervals read from the specified file name.private
HistogramLogScanner(java.util.Scanner scanner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close underlying scanner.boolean
hasNextLine()
Indicates whether or not additional intervals may exist in the logprivate void
initScanner()
void
process(HistogramLogScanner.EventHandler handler)
-
-
-
Field Detail
-
lazyReader
private final HistogramLogScanner.LazyHistogramReader lazyReader
-
scanner
protected final java.util.Scanner scanner
-
-
Constructor Detail
-
HistogramLogScanner
public HistogramLogScanner(java.lang.String inputFileName) throws java.io.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:
java.io.FileNotFoundException
- when unable to find inputFileName
-
HistogramLogScanner
public HistogramLogScanner(java.io.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(java.io.File inputFile) throws java.io.FileNotFoundException
Constructs a new HistogramLogReader that produces intervals read from the specified file.- Parameters:
inputFile
- The File to read from- Throws:
java.io.FileNotFoundException
- when unable to find inputFile
-
HistogramLogScanner
private HistogramLogScanner(java.util.Scanner scanner)
-
-
Method Detail
-
initScanner
private void initScanner()
-
close
public void close()
Close underlying scanner.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
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
-
-