Package org.moeaframework.analysis.io
Class SampleReader
java.lang.Object
org.moeaframework.analysis.io.SampleReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<TypedProperties>
,Iterator<TypedProperties>
public class SampleReader
extends Object
implements Iterable<TypedProperties>, Iterator<TypedProperties>, 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 TypedProperties
map the parameter
name to the parameter value.- See Also:
-
Constructor Summary
ConstructorDescriptionSampleReader
(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
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
-
SampleReader
Constructs a sample reader for reading parameter samples from the specified file.- Parameters:
file
- the parameter sample fileparameterFile
- the parameter definition file- Throws:
IOException
- if an I/O error occurred
-
SampleReader
Constructs a sample reader for reading parameter samples from the underlying reader.- Parameters:
reader
- the underlying readerparameterFile
- the parameter definition file
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceIterable<TypedProperties>
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<TypedProperties>
-
next
- Specified by:
next
in interfaceIterator<TypedProperties>
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<TypedProperties>
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-