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 readOctaveObject
s. The octave type which can be read is given byoctaveType()
whereasread(BufferedReader)
performs reading.The according implementations are in package
eu.simuline.octave.io.impl
and 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>
rEADERS
Maps theoctaveType()
of anOctaveDataReader
to theOctaveDataReader
itself 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 OctaveDataReader
getOctaveDataReader(String type)
private static void
initReaderIfNecessary()
abstract String
octaveType()
Could be "scalar" or "string" or something else.abstract OctaveObject
read(BufferedReader reader)
Reads anOctaveObject
from a Readerreader
.
-
-
-
Field Detail
-
rEADERS
private static Map<String,OctaveDataReader> rEADERS
Maps theoctaveType()
of anOctaveDataReader
to theOctaveDataReader
itself 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 anOctaveObject
from a Readerreader
.- Parameters:
reader
- the Reader to read from, will not close reader- Returns:
- the object read from
reader
.
-
-