|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.jsmat.MatWriter<D>
D - output typepublic abstract class MatWriter<D extends DataOutput>
MatWriter is an abstract superclass for different writers producing .mat formatted output.
Common subclasses are
MatFileWriter preferrable if files are writtenMatOutputStreamWriter to write to output streams
| Field Summary | |
|---|---|
protected ReservedWriter |
mReservedWriter
|
| Constructor Summary | |
|---|---|
MatWriter(D out)
|
|
| Method Summary | ||
|---|---|---|
protected void |
checkNoReservedWriter()
Throws an io exception if an open reserved writer exists |
|
abstract void |
close()
Close the target. |
|
ReservedComplexWriter |
createReservedWriter(String name,
MatReservedComplex reserved)
Creates a writer for the given reserved variable. |
|
|
createReservedWriter(String name,
MatReservedMatrix<A> reserved)
Creates a writer for the given reserved variable. |
|
protected abstract VariableWriter |
createVariableWriter()
Creates a writer for variable output. |
|
protected abstract void |
initDataOutput(D dataOutput)
StackTrace called in the constructor before anything is written to the data output. |
|
void |
write(Map<String,? extends MatAllocated> variables)
Write the given matrices. |
|
void |
write(String name,
MatAllocated variable)
Write the given matrix |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ReservedWriter mReservedWriter
| Constructor Detail |
|---|
public MatWriter(D out)
throws IOException
IOException| Method Detail |
|---|
protected abstract void initDataOutput(D dataOutput)
throws IOException
dataOutput - the data output object to initialize
IOException
protected abstract VariableWriter createVariableWriter()
throws IOException
VariableWriter.open() is called. The same structures must be
released again after writing the variable data, which is done in
VariableWriter.close().
IOException
public void write(String name,
MatAllocated variable)
throws IOException
name - name of the matrixvariable - the variable containing the data
IOException - if any io exception occurs
protected void checkNoReservedWriter()
throws IOException
IOException
public ReservedComplexWriter createReservedWriter(String name,
MatReservedComplex reserved)
throws IOException
name - The matlab name of the variablereserved - The variable reserving space for data
IOException - If another unclosed reserved writer exists, or if
any other io exception occurs
public <A> ReservedMatrixWriter<A> createReservedWriter(String name,
MatReservedMatrix<A> reserved)
throws IOException
A - The java data type, defined by the reserved variablename - The matlab name of the variablereserved - The variable reserving space for data
IOException - If another unclosed reserved writer exists, or if
any other io exception occurs
public void write(Map<String,? extends MatAllocated> variables)
throws IOException
LinkedHashMap
in order to preserve the order of the variables, or TreeMap to
sort the variables lexicographically.
The method write(String, MatAllocated) is invoked with every
name/value pair in matrices.
variables - a map containing name/variable pairs to be written
IOException - if any io exception occurs
public abstract void close()
throws IOException
IOException - if any io exception occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||