com.jmatio.types
Class MLStructure

java.lang.Object
  extended by com.jmatio.types.MLArray
      extended by com.jmatio.types.MLStructure

public class MLStructure
extends MLArray

This class represents Matlab's Structure object (struct array). Note: array of structures can contain only structures of the same type , that means structues that have the same field names.

Author:
Wojciech Gradkowski

Field Summary
 
Fields inherited from class com.jmatio.types.MLArray
attributes, dims, mtFLAG_COMPLEX, mtFLAG_GLOBAL, mtFLAG_LOGICAL, mtFLAG_TYPE, mxCELL_CLASS, mxCHAR_CLASS, mxDOUBLE_CLASS, mxFUNCTION_CLASS, mxINT16_CLASS, mxINT32_CLASS, mxINT64_CLASS, mxINT8_CLASS, mxOBJECT_CLASS, mxOPAQUE_CLASS, mxSINGLE_CLASS, mxSPARSE_CLASS, mxSTRUCT_CLASS, mxUINT16_CLASS, mxUINT32_CLASS, mxUINT64_CLASS, mxUINT8_CLASS, mxUNKNOWN_CLASS, name, type
 
Constructor Summary
MLStructure(String name, int[] dims)
           
MLStructure(String name, int[] dims, int type, int attributes)
           
 
Method Summary
 String contentToString()
           
 Collection<MLArray> getAllFields()
          Gets all field from sruct array as flat list of fields.
 MLArray getField(String name)
          Gets a value of the field described by name from current structe in struc array.
 MLArray getField(String name, int index)
          Gets a value of the field described by name from index'th structe in struc array.
 MLArray getField(String name, int m, int n)
          Gets a value of the field described by name from (m,n)'th structe in struc array.
 byte[] getKeySetToByteArray()
          Dumps field names to byte array.
 int getMaxFieldLenth()
          Gets the maximum length of field desctiptor
 void setField(String name, MLArray value)
          Sets field for current structure
 void setField(String name, MLArray value, int index)
          Sets filed for structure described by index in struct array
 void setField(String name, MLArray value, int m, int n)
          Sets field for (m,n)'th structure in struct array
 
Methods inherited from class com.jmatio.types.MLArray
getDimensions, getFlags, getIndex, getM, getN, getName, getNameToByteArray, getNDimensions, getSize, getType, isCell, isChar, isComplex, isDouble, isEmpty, isFunctionObject, isInt16, isInt32, isInt64, isInt8, isLogical, isObject, isOpaque, isSingle, isSparse, isStruct, isUint16, isUint32, isUint64, isUint8, isUnknown, toString, typeToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MLStructure

public MLStructure(String name,
                   int[] dims)

MLStructure

public MLStructure(String name,
                   int[] dims,
                   int type,
                   int attributes)
Method Detail

setField

public void setField(String name,
                     MLArray value)
Sets field for current structure

Parameters:
name - - name of the field
value - - MLArray field value

setField

public void setField(String name,
                     MLArray value,
                     int m,
                     int n)
Sets field for (m,n)'th structure in struct array

Parameters:
name - - name of the field
value - - MLArray field value

setField

public void setField(String name,
                     MLArray value,
                     int index)
Sets filed for structure described by index in struct array

Parameters:
name - - name of the field
value - - MLArray field value
index - the index

getMaxFieldLenth

public int getMaxFieldLenth()
Gets the maximum length of field desctiptor


getKeySetToByteArray

public byte[] getKeySetToByteArray()
Dumps field names to byte array. Field names are written as Zero End Strings


getAllFields

public Collection<MLArray> getAllFields()
Gets all field from sruct array as flat list of fields.


getField

public MLArray getField(String name)
Gets a value of the field described by name from current structe in struc array.

Parameters:
name - the field name

getField

public MLArray getField(String name,
                        int m,
                        int n)
Gets a value of the field described by name from (m,n)'th structe in struc array.


getField

public MLArray getField(String name,
                        int index)
Gets a value of the field described by name from index'th structe in struc array.


contentToString

public String contentToString()
Overrides:
contentToString in class MLArray