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 (structure array). Note: array of structures can contain only structures of the same type , that means structures 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.
 Collection<String> getFieldNames()
          Returns the Collection of keys for this structure.
 byte[] getKeySetToByteArray()
          Dumps field names to byte array.
 int getMaxFieldLenth()
          Gets the maximum length of field descriptor
 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
dispose, 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
m -
n -

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 -

getMaxFieldLenth

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

Returns:

getKeySetToByteArray

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

Returns:

getAllFields

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

Returns:

getFieldNames

public Collection<String> getFieldNames()
Returns the Collection of keys for this structure.

Returns:
the Collection of keys for this structure

getField

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

Parameters:
name -
Returns:

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.

Parameters:
name -
m -
n -
Returns:

getField

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

Parameters:
name -
index -
Returns:

contentToString

public String contentToString()
Overrides:
contentToString in class MLArray


Copyright © 2006–2013 GeoSolutions. All rights reserved.