Package eu.simuline.octave.io.spi
Class OctaveDataReader
- java.lang.Object
-
- eu.simuline.octave.io.spi.OctaveDataReader
-
- Direct Known Subclasses:
AbstractOctaveStringReader,AbstractPrimitiveMatrixReader,AbstractPrimitiveScalarReader,CellReader,ComplexMatrixReader,ComplexScalarReader,FakeRangeReader,ScalarStructReader,SparseBooleanReader,StructReader
public abstract class OctaveDataReader extends Object
Service Provider Interface for the IO handler that can readOctaveObjects. The octave type which can be read is given byoctaveType()whereasread(BufferedReader)performs reading.The according implementations are in package
eu.simuline.octave.io.impland extend this class. These classes are registered in the jar-file underMETA-INF/services/eu.simuline.octave.io.OctaveDataReader.
-
-
Field Summary
Fields Modifier and Type Field Description private static Map<String,OctaveDataReader>rEADERSMaps theoctaveType()of anOctaveDataReaderto theOctaveDataReaderitself which is able to read the octave type from a reader.
-
Constructor Summary
Constructors Constructor Description OctaveDataReader()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static OctaveDataReadergetOctaveDataReader(String type)private static voidinitReaderIfNecessary()abstract StringoctaveType()Could be "scalar" or "string" or something else.abstract OctaveObjectread(BufferedReader reader)Reads anOctaveObjectfrom a Readerreader.
-
-
-
Field Detail
-
rEADERS
private static Map<String,OctaveDataReader> rEADERS
Maps theoctaveType()of anOctaveDataReaderto theOctaveDataReaderitself which is able to read the octave type from a reader.
-
-
Method Detail
-
getOctaveDataReader
public static OctaveDataReader getOctaveDataReader(String type)
- Parameters:
type-- Returns:
- The OctaveDataReader or null if it does not exist
-
initReaderIfNecessary
private static void initReaderIfNecessary()
-
octaveType
public abstract String octaveType()
Could be "scalar" or "string" or something else.- Returns:
- the string representation of the octave type
read by this
OctaveDataReader
-
read
public abstract OctaveObject read(BufferedReader reader)
Reads anOctaveObjectfrom a Readerreader.- Parameters:
reader- the Reader to read from, will not close reader- Returns:
- the object read from
reader.
-
-