MOEA Framework 2.12
API Specification

org.moeaframework.analysis.sensitivity
Class ResultFileReader

java.lang.Object
  extended by org.moeaframework.analysis.sensitivity.ResultFileReader
All Implemented Interfaces:
Closeable, Iterable<ResultEntry>, Iterator<ResultEntry>

public class ResultFileReader
extends Object
implements Closeable, Iterator<ResultEntry>, Iterable<ResultEntry>

Reads result files created by ResultFileWriter. See the documentation for ResultWriter for a description of the file format.

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 ResultWriter to resume processing at a valid state.

See Also:
ResultFileWriter

Constructor Summary
ResultFileReader(Problem problem, File file)
          Constructs a result file reader for reading the approximation sets from the specified result file.
 
Method Summary
 void close()
           
 Variable decode(Variable variable, String string)
          Decodes string representations of decision variables, returning the variable with the decoded value.
 boolean hasNext()
           
 Iterator<ResultEntry> iterator()
           
 ResultEntry next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultFileReader

public ResultFileReader(Problem problem,
                        File file)
                 throws IOException
Constructs a result file reader for reading the approximation sets from the specified result file.

Parameters:
problem - the problem
file - the file containing the results
Throws:
IOException - if an I/O error occurred
Method Detail

close

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

next

public ResultEntry next()
Specified by:
next in interface Iterator<ResultEntry>

iterator

public Iterator<ResultEntry> iterator()
Specified by:
iterator in interface Iterable<ResultEntry>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<ResultEntry>

remove

public void remove()
Specified by:
remove in interface Iterator<ResultEntry>

decode

public Variable decode(Variable variable,
                       String string)
Decodes string representations of decision variables, returning the variable with the decoded value. Depending on the implementation and variable type, the same variable as provided in the arguments or a new variable will be returned.

Parameters:
variable - the decision variable
string - the string representation of the decision variable
Returns:
the variable with the decoded value
See Also:
ResultFileWriter.encode(Variable)

MOEA Framework 2.12
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!