Package org.moeaframework.analysis.io
Class MetricFileReader
java.lang.Object
org.moeaframework.analysis.io.MatrixReader
org.moeaframework.analysis.io.MetricFileReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<double[]>
,Iterator<double[]>
Reader for metric files produced by
MetricFileWriter
. The file can contain commented lines starting with
'#' characters.
This reader is expected to gracefully recover from incomplete or improperly formatted files. Unless a serious I/O
error occurred, this reader will attempt to load the file to the last valid entry. This requirement enables a
MetricFileWriter
to resume processing at a valid state.
- See Also:
-
Constructor Summary
ConstructorDescriptionMetricFileReader
(File file) Constructs a metric file reader for reading metric files from the specified file.MetricFileReader
(Reader reader) Constructs a metric file reader for reading metric files from the underlying reader. -
Method Summary
Methods inherited from class org.moeaframework.analysis.io.MatrixReader
close, hasNext, iterator, load, next, readAll, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
MetricFileReader
Constructs a metric file reader for reading metric files from the specified file.- Parameters:
file
- the metric file- Throws:
FileNotFoundException
- if the file was not found
-
MetricFileReader
Constructs a metric file reader for reading metric files from the underlying reader.- Parameters:
reader
- the underlying reader
-
-
Method Details
-
open
Opens a metric file for reading.- Parameters:
file
- the metric file- Returns:
- the reader
- Throws:
FileNotFoundException
- if the file was not found
-