MOEA Framework 2.5
API Specification

org.moeaframework.analysis.sensitivity
Class SampleReader

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

public class SampleReader
extends Object
implements Iterable<Properties>, Iterator<Properties>, Closeable

Reads the parameter samples from the output of SampleGenerator. The column ordering in the sample file matches the ordering of parameters in a ParameterFile. The read Properties map the parameter name to the parameter value.

See Also:
SampleGenerator, ParameterFile

Constructor Summary
SampleReader(File file, ParameterFile parameterFile)
          Constructs a sample reader for reading parameter samples from the specified file.
SampleReader(Reader reader, ParameterFile parameterFile)
          Constructs a sample reader for reading parameter samples from the underlying reader.
 
Method Summary
 void close()
          Closes this stream and releases any system resources associated with it.
 boolean hasNext()
          Returns true if the iteration has more elements.
 Iterator<Properties> iterator()
          Returns an iterator over a set of elements of type T.
 Properties next()
          Returns the next element in the iteration.
 void remove()
          Removes from the underlying collection the last element returned by this iterator (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleReader

public SampleReader(File file,
                    ParameterFile parameterFile)
             throws IOException
Constructs a sample reader for reading parameter samples from the specified file.

Parameters:
file - the parameter sample file
parameterFile - the parameter definition file
Throws:
IOException - if an I/O error occurred

SampleReader

public SampleReader(Reader reader,
                    ParameterFile parameterFile)
Constructs a sample reader for reading parameter samples from the underlying reader.

Parameters:
reader - the underlying reader
parameterFile - the parameter definition file
Method Detail

iterator

public Iterator<Properties> iterator()
Description copied from interface: java.lang.Iterable
Returns an iterator over a set of elements of type T.

Specified by:
iterator in interface Iterable<Properties>
Returns:
an Iterator.

hasNext

public boolean hasNext()
Description copied from interface: java.util.Iterator
Returns true if the iteration has more elements. (In other words, returns true if Iterator.next() would return an element rather than throwing an exception.)

Specified by:
hasNext in interface Iterator<Properties>
Returns:
true if the iteration has more elements

next

public Properties next()
Description copied from interface: java.util.Iterator
Returns the next element in the iteration.

Specified by:
next in interface Iterator<Properties>
Returns:
the next element in the iteration

remove

public void remove()
Description copied from interface: java.util.Iterator
Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to Iterator.next(). The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.

Specified by:
remove in interface Iterator<Properties>

close

public void close()
           throws IOException
Description copied from interface: java.io.Closeable
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

Specified by:
close in interface Closeable
Throws:
IOException - if an I/O error occurs

MOEA Framework 2.5
API Specification

Copyright 2009-2015 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Hosted by Get MOEA Framework at SourceForge.net. Fast, secure and Free Open Source software downloads