MOEA Framework 2.9
API Specification

org.moeaframework.analysis.sensitivity
Class MetricFileReader

java.lang.Object
  extended by org.moeaframework.analysis.sensitivity.MetricFileReader
All Implemented Interfaces:
Closeable, Iterable<double[]>, Iterator<double[]>

public class MetricFileReader
extends Object

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:
MetricFileWriter

Constructor Summary
MetricFileReader(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
 void close()
           
 boolean hasNext()
           
 Iterator<double[]> iterator()
           
 double[] next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricFileReader

public MetricFileReader(File file)
                 throws FileNotFoundException
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

public MetricFileReader(Reader reader)
Constructs a metric file reader for reading metric files from the underlying reader.

Parameters:
reader - the underlying reader
Method Detail

iterator

public Iterator<double[]> iterator()
Specified by:
iterator in interface Iterable<double[]>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<double[]>

next

public double[] next()
Specified by:
next in interface Iterator<double[]>

remove

public void remove()
Specified by:
remove in interface Iterator<double[]>

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

MOEA Framework 2.9
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!