org.scilab.modules.types
Class ScilabBooleanReference

java.lang.Object
  extended by org.scilab.modules.types.ScilabBoolean
      extended by org.scilab.modules.types.ScilabBooleanReference
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, ScilabType

public class ScilabBooleanReference
extends ScilabBoolean

This class provides a representation on the Scilab boolean datatype

This class is Serializable and any modification could impact load and store of data (Xcos files, Javasci saved data, etc...).

Example:
boolean [][]a={{true,false,true}, {true,true,true}};
ScilabBoolean aMatrix = new ScilabBoolean(a);

See Also:
Scilab, Serialized Form

Field Summary
 
Fields inherited from class org.scilab.modules.types.ScilabBoolean
byref, data, swaped, varName
 
Constructor Summary
ScilabBooleanReference(java.lang.String varName, java.nio.IntBuffer data, int nbRows, int nbCols)
          Create an object from an array of array of boolean
 
Method Summary
 boolean[][] getData()
          Return the data
 boolean getElement(int i, int j)
          Get the element at position (i, j)
 int getHeight()
          Return the height (number of element) of the stored data
 java.lang.Object getRawData()
          
 int getWidth()
          Return the width (number of element) of the stored data
 boolean isEmpty()
          Check the emptiness of the associated data.
 void setData(boolean[][] data)
          Change the value with the provided data
 void setElement(int i, int j, boolean x)
          Set the element at position (i, j)
 
Methods inherited from class org.scilab.modules.types.ScilabBoolean
equals, getSerializedObject, getType, getVarName, isReference, isSwaped, readExternal, toString, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScilabBooleanReference

public ScilabBooleanReference(java.lang.String varName,
                              java.nio.IntBuffer data,
                              int nbRows,
                              int nbCols)
Create an object from an array of array of boolean

Parameters:
data - the array of boolean
Method Detail

isEmpty

public boolean isEmpty()
Check the emptiness of the associated data.

Specified by:
isEmpty in interface ScilabType
Overrides:
isEmpty in class ScilabBoolean
Returns:
true, if the associated data array is empty.

getElement

public boolean getElement(int i,
                          int j)
Get the element at position (i, j)

Overrides:
getElement in class ScilabBoolean
Parameters:
i - the first coordinate
j - the second coordinate
Returns:
the corresponding boolean

setElement

public void setElement(int i,
                       int j,
                       boolean x)
Set the element at position (i, j)

Overrides:
setElement in class ScilabBoolean
Parameters:
i - the first coordinate
j - the second coordinate
x - the new value

setData

public void setData(boolean[][] data)
Change the value with the provided data

Overrides:
setData in class ScilabBoolean
Parameters:
data - array of boolean

getData

public boolean[][] getData()
Return the data

Overrides:
getData in class ScilabBoolean
Returns:
the array of array of boolean

getRawData

public java.lang.Object getRawData()

Overrides:
getRawData in class ScilabBoolean
Returns:
the data

getHeight

public int getHeight()
Return the height (number of element) of the stored data

Specified by:
getHeight in interface ScilabType
Overrides:
getHeight in class ScilabBoolean
Returns:
the height

getWidth

public int getWidth()
Return the width (number of element) of the stored data

Specified by:
getWidth in interface ScilabType
Overrides:
getWidth in class ScilabBoolean
Returns:
the width