Package eu.simuline.octave.exec
Class OctaveReaderCallable
- java.lang.Object
- 
- eu.simuline.octave.exec.OctaveReaderCallable
 
- 
 final class OctaveReaderCallable extends Object implements Callable<Void> Callablethat reads from the octave process. Used inOctaveExec.evalRW(WriteFunctor, ReadFunctor)only. This is complementary toOctaveWriterCallable.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description (package private) classOctaveReaderCallable.OctaveExecuteReaderReader that passes the reading on to the output from the octave process, i.e. fromprocessReaderuntil the spacerspacerreached, then it returns EOF.
 - 
Field SummaryFields Modifier and Type Field Description private static org.apache.commons.logging.LogLOGprivate static StringMSG_IOE_CLSprivate static StringMSG_IOE_READprivate BufferedReaderprocessReaderThe reader for feedback on scripts received from octave.private ReadFunctorreadFunctorThe functor the reading task is delegated to.private StringspacerA string essentially consisting of a unique hashvalue.
 - 
Constructor SummaryConstructors Constructor Description OctaveReaderCallable(BufferedReader processReader, ReadFunctor readFunctor, String spacer)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Voidcall()Calling essentially reads fromprocessReaderrepresenting the octave process: Reads untilspaceris detected which is not really read but is interpreted as an eof symbol.
 
- 
- 
- 
Field Detail- 
LOGprivate static final org.apache.commons.logging.Log LOG 
 - 
MSG_IOE_READprivate static final String MSG_IOE_READ - See Also:
- Constant Field Values
 
 - 
MSG_IOE_CLSprivate static final String MSG_IOE_CLS - See Also:
- Constant Field Values
 
 - 
processReaderprivate final BufferedReader processReader The reader for feedback on scripts received from octave. This is nothing butOctaveExec.processReader.
 - 
readFunctorprivate final ReadFunctor readFunctor The functor the reading task is delegated to.
 - 
spacerprivate final String spacer A string essentially consisting of a unique hashvalue. It has been printed by the accordingOctaveWriterCallableafter having applied the write functor and thus indicates the end of the read sequence of the octave process.
 
- 
 - 
Constructor Detail- 
OctaveReaderCallableOctaveReaderCallable(BufferedReader processReader, ReadFunctor readFunctor, String spacer) - Parameters:
- processReader- the reader used for reading.
- readFunctor- the functor the reading process is delegated to.
- spacer- a string essentially consisting of a unique hashvalue printed at the end of the according write process in- OctaveExec.evalRW(WriteFunctor, ReadFunctor)and thus signifying the end of the sequence to be read.
 
 
- 
 - 
Method Detail- 
callpublic Void call() Calling essentially reads fromprocessReaderrepresenting the octave process: Reads untilspaceris detected which is not really read but is interpreted as an eof symbol. To that end,processReaderis wrapped into anOctaveReaderCallable.OctaveExecuteReaderwith parameterspacerwhich yields eof if the spacer is detected. Closing theOctaveReaderCallable.OctaveExecuteReaderreads the spacer without passing it further. Exceptions are logged onLOG.- Specified by:
- callin interface- Callable<Void>
- Throws:
- OctaveIOException- if underlying- readFunctoror the reader- processReaderor the wrapping- OctaveReaderCallable.OctaveExecuteReaderthrows an- IOException.
 
 
- 
 
-