ch.javasoft.jsmat.variable
Class MatAllocated

java.lang.Object
  extended by ch.javasoft.jsmat.variable.MatVariable
      extended by ch.javasoft.jsmat.variable.MatAllocated
Direct Known Subclasses:
MatCell, MatMatrix, MatStructure

public abstract class MatAllocated
extends MatVariable

MatAllocated is a variable which allocates space and data. Such variables are the most simple to use, e.g. to allocate matrix variables by passing the data they represent.

For large matrices, MatReserved variables might be preferable since they only reserve space, but do not allocate it.


Field Summary
 
Fields inherited from class ch.javasoft.jsmat.variable.MatVariable
DEFAULT_NAME, mDims, mMatClass
 
Constructor Summary
MatAllocated(MatClass matClass, int[] dims)
          Constructor for subclasses with matrix class and dimensions
 
Method Summary
 void write(String name, DataOutput out)
          Writes the data to the given data output.
protected abstract  void writeRawData(DataOutput out)
          Write the raw data to the given output, excluding type, size, name etc.
 
Methods inherited from class ch.javasoft.jsmat.variable.MatVariable
checkRawDataSizeOverflow, checkValueLength, getDimLength, getFlags, getRawDataSize, getSize, writeStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatAllocated

public MatAllocated(MatClass matClass,
                    int[] dims)
Constructor for subclasses with matrix class and dimensions

Parameters:
matClass - the matrix class constant
dims - the matrix dimensions
Method Detail

writeRawData

protected abstract void writeRawData(DataOutput out)
                              throws IOException
Write the raw data to the given output, excluding type, size, name etc. This method is implemented by the type specific subclasses.

Parameters:
out - the data output to write to
Throws:
IOException - if any io exception occurs

write

public void write(String name,
                  DataOutput out)
           throws IOException
Writes the data to the given data output. At the end of this method, writeRawData(DataOutput) is called to write the type specific data.

Throws:
IOException