org.scilab.modules.types
Class ScilabIntegerReference

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

public class ScilabIntegerReference
extends ScilabInteger

This class provides a representation on the Scilab Integer datatype

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

Example:
byte [][]a={{32,42,41}, {12,13,32}};
ScilabInteger aMatrix = new ScilabInteger(a, true); // true = unsigned

See Also:
Scilab, Serialized Form

Field Summary
 
Fields inherited from class org.scilab.modules.types.ScilabInteger
byref, byteData, intData, longData, precision, shortData, swaped, varName
 
Constructor Summary
ScilabIntegerReference()
          Default constructor
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare if obj is the same object or not
 byte getByteElement(int i, int j)
          Get the byte element at position (i, j)
 java.lang.Object getCorrectData()
          Get the data as a array of arrays
 byte[][] getDataAsByte()
          Returns the value as the form of byte
 int[][] getDataAsInt()
          Returns the value as the form of int
 long[][] getDataAsLong()
          Returns the value as the form of long Only for Scilab 6.X
 short[][] getDataAsShort()
          Returns the value as the form of short
 int getHeight()
          Return the height (number of elements) of the stored data
 int getIntElement(int i, int j)
          Get the int element at position (i, j)
 long getLongElement(int i, int j)
          Get the long element at position (i, j)
 java.lang.Object getRawData()
          Get the data as they are
 short getShortElement(int i, int j)
          Get the short element at position (i, j)
 int getWidth()
          Return the width (number of elements) of the stored data
 boolean isEmpty()
          Check if the current instance is empty.
 void setByteElement(int i, int j, byte x)
          Set the byte element at position (i, j)
 void setData(byte[][] data, boolean bUnsigned)
          Set the current values
 void setData(int[][] data, boolean bUnsigned)
          Set the current values
 void setData(long[][] data, boolean bUnsigned)
          Set the current values
 void setData(short[][] data, boolean bUnsigned)
          Set the current values
 void setIntElement(int i, int j, int x)
          Set the int element at position (i, j)
 void setLongElement(int i, int j, long x)
          Set the long element at position (i, j)
 void setShortElement(int i, int j, short x)
          Set the short element at position (i, j)
 
Methods inherited from class org.scilab.modules.types.ScilabInteger
convertOldType, getData, getElement, getPrec, getSerializedObject, getType, getVarName, isReference, isSwaped, isUnsigned, readExternal, setElement, toString, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScilabIntegerReference

public ScilabIntegerReference()
Default constructor

Method Detail

getByteElement

public byte getByteElement(int i,
                           int j)
Get the byte element at position (i, j)

Overrides:
getByteElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
Returns:
a byte

getShortElement

public short getShortElement(int i,
                             int j)
Get the short element at position (i, j)

Overrides:
getShortElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
Returns:
a short

getIntElement

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

Overrides:
getIntElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
Returns:
a int

getLongElement

public long getLongElement(int i,
                           int j)
Get the long element at position (i, j)

Overrides:
getLongElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
Returns:
a long

setByteElement

public void setByteElement(int i,
                           int j,
                           byte x)
Set the byte element at position (i, j)

Overrides:
setByteElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
x - the byte to set

setShortElement

public void setShortElement(int i,
                            int j,
                            short x)
Set the short element at position (i, j)

Overrides:
setShortElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
x - the short to set

setIntElement

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

Overrides:
setIntElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
x - the int to set

setLongElement

public void setLongElement(int i,
                           int j,
                           long x)
Set the long element at position (i, j)

Overrides:
setLongElement in class ScilabInteger
Parameters:
i - the row index
j - the column index
x - the long to set

setData

public void setData(byte[][] data,
                    boolean bUnsigned)
Set the current values

Overrides:
setData in class ScilabInteger
Parameters:
data - the values to set
bUnsigned - true, if these values are unsigned; false otherwise.

setData

public void setData(short[][] data,
                    boolean bUnsigned)
Set the current values

Overrides:
setData in class ScilabInteger
Parameters:
data - the values to set
bUnsigned - true, if these values are unsigned; false otherwise.

setData

public void setData(int[][] data,
                    boolean bUnsigned)
Set the current values

Overrides:
setData in class ScilabInteger
Parameters:
data - the values to set
bUnsigned - true, if these values are unsigned; false otherwise.

setData

public void setData(long[][] data,
                    boolean bUnsigned)
Set the current values

Overrides:
setData in class ScilabInteger
Parameters:
data - the values to set
bUnsigned - true, if these values are unsigned; false otherwise.

getDataAsShort

public short[][] getDataAsShort()
Returns the value as the form of short

Overrides:
getDataAsShort in class ScilabInteger
Returns:
the values as short

getDataAsByte

public byte[][] getDataAsByte()
Returns the value as the form of byte

Overrides:
getDataAsByte in class ScilabInteger
Returns:
the values as byte

getDataAsInt

public int[][] getDataAsInt()
Returns the value as the form of int

Overrides:
getDataAsInt in class ScilabInteger
Returns:
the values as int

getDataAsLong

public long[][] getDataAsLong()
Returns the value as the form of long Only for Scilab 6.X

Overrides:
getDataAsLong in class ScilabInteger
Returns:
the values as long

getHeight

public int getHeight()
Description copied from interface: ScilabType
Return the height (number of elements) of the stored data

Specified by:
getHeight in interface ScilabType
Overrides:
getHeight in class ScilabInteger
Returns:
the height of the value matrix
See Also:
ScilabType.getHeight()

getWidth

public int getWidth()
Description copied from interface: ScilabType
Return the width (number of elements) of the stored data

Specified by:
getWidth in interface ScilabType
Overrides:
getWidth in class ScilabInteger
Returns:
the width of the value matrix
See Also:
ScilabType.getWidth()

isEmpty

public boolean isEmpty()
Description copied from interface: ScilabType
Check if the current instance is empty.

Specified by:
isEmpty in interface ScilabType
Overrides:
isEmpty in class ScilabInteger
Returns:
true, if there is no values; false otherwise.

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: ScilabType
Compare if obj is the same object or not

Specified by:
equals in interface ScilabType
Overrides:
equals in class ScilabInteger
Parameters:
obj - the object we want to compare
Returns:
true if the two objects are equals, false otherwise
See Also:
ScilabType.equals(Object)

getRawData

public java.lang.Object getRawData()
Get the data as they are

Overrides:
getRawData in class ScilabInteger
Returns:
the data

getCorrectData

public java.lang.Object getCorrectData()
Get the data as a array of arrays

Overrides:
getCorrectData in class ScilabInteger
Returns:
the data