fr.umlv.corosol.component
Interface JArray

All Superinterfaces:
JAllocatable, JHeapObject, JObject
All Known Implementing Classes:
DefaultJArray, NativeArray

public interface JArray
extends JHeapObject, JAllocatable

An array allocated into the Corosol JVM heap. This interface provides method for reading and writing value at a specified index into an array.

Author:
Christophe Deleray

Field Summary
static int T_BOOLEAN
          The tag associated with an array of boolean.
static int T_BYTE
          The tag associated with an array of byte.
static int T_CHAR
          The tag associated with an array of char.
static int T_DOUBLE
          The tag associated with an array of double.
static int T_FLOAT
          The tag associated with an array of float.
static int T_INT
          The tag associated with an array of int.
static int T_LONG
          The tag associated with an array of long.
static int T_SHORT
          The tag associated with an array of short.
 
Method Summary
 boolean getBoolean(int index)
          Returns the boolean value stored at the specified index.
 byte getByte(int index)
          Returns the byte value stored at the specified index.
 char getChar(int index)
          Returns the char value stored at the specified index.
 JClass getComponentType()
          Returns the component type of this array.
 double getDouble(int index)
          Returns the double value stored at the specified index.
 float getFloat(int index)
          Returns the float value stored at the specified index.
 int getInt(int index)
          Returns the int value stored at the specified index.
 long getLong(int index)
          Returns the long value stored at the specified index.
 JHeapObject getObject(int index)
          Returns the object whose the reference value is stored at the specified index.
 short getShort(int index)
          Returns the short value stored at the specified index.
 int length()
          Returns the length of this array.
 void setBoolean(boolean value, int index)
          Sets the specified entry with a specified boolean value.
 void setByte(byte value, int index)
          Sets the specified entry with a specified byte value.
 void setChar(char value, int index)
          Sets the specified entry with a specified char value.
 void setDouble(double value, int index)
          Sets the specified entry with a specified double value.
 void setFloat(float value, int index)
          Sets the specified entry with a specified float value.
 void setInt(int value, int index)
          Sets the specified entry with a specified int value.
 void setLayout(JArrayLayout layout)
          Sets the layout of the array representing by this JArray object.
 void setLong(long value, int index)
          Sets the specified entry with a specified long value.
 void setObject(JHeapObject object, int index)
          Sets the specified entry with the reference of the specified object.
 void setShort(short value, int index)
          Sets the specified entry with a specified short value.
 
Methods inherited from interface fr.umlv.corosol.component.JHeapObject
getNativeObject, getType, isNative
 
Methods inherited from interface fr.umlv.corosol.component.JAllocatable
getPosition, getSize, setPosition
 

Field Detail

T_BOOLEAN

static final int T_BOOLEAN
The tag associated with an array of boolean.

See Also:
Constant Field Values

T_CHAR

static final int T_CHAR
The tag associated with an array of char.

See Also:
Constant Field Values

T_FLOAT

static final int T_FLOAT
The tag associated with an array of float.

See Also:
Constant Field Values

T_DOUBLE

static final int T_DOUBLE
The tag associated with an array of double.

See Also:
Constant Field Values

T_BYTE

static final int T_BYTE
The tag associated with an array of byte.

See Also:
Constant Field Values

T_SHORT

static final int T_SHORT
The tag associated with an array of short.

See Also:
Constant Field Values

T_INT

static final int T_INT
The tag associated with an array of int.

See Also:
Constant Field Values

T_LONG

static final int T_LONG
The tag associated with an array of long.

See Also:
Constant Field Values
Method Detail

length

int length()
Returns the length of this array.


getComponentType

JClass getComponentType()
Returns the component type of this array.


getBoolean

boolean getBoolean(int index)
Returns the boolean value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getByte

byte getByte(int index)
Returns the byte value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getChar

char getChar(int index)
Returns the char value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getDouble

double getDouble(int index)
Returns the double value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getFloat

float getFloat(int index)
Returns the float value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getInt

int getInt(int index)
Returns the int value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getLong

long getLong(int index)
Returns the long value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getShort

short getShort(int index)
Returns the short value stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the value stored at the specified index

getObject

JHeapObject getObject(int index)
Returns the object whose the reference value is stored at the specified index.

Parameters:
index - an index of an entry
Returns:
the object whose the reference value is stored at the specified index

setBoolean

void setBoolean(boolean value,
                int index)
Sets the specified entry with a specified boolean value.

Parameters:
value - the value to be stored
index - an index of an entry

setByte

void setByte(byte value,
             int index)
Sets the specified entry with a specified byte value.

Parameters:
value - the value to be stored
index - an index of an entry

setChar

void setChar(char value,
             int index)
Sets the specified entry with a specified char value.

Parameters:
value - the value to be stored
index - an index of an entry

setDouble

void setDouble(double value,
               int index)
Sets the specified entry with a specified double value.

Parameters:
value - the value to be stored
index - an index of an entry

setFloat

void setFloat(float value,
              int index)
Sets the specified entry with a specified float value.

Parameters:
value - the value to be stored
index - an index of an entry

setInt

void setInt(int value,
            int index)
Sets the specified entry with a specified int value.

Parameters:
value - the value to be stored
index - an index of an entry

setLong

void setLong(long value,
             int index)
Sets the specified entry with a specified long value.

Parameters:
value - the value to be stored
index - an index of an entry

setShort

void setShort(short value,
              int index)
Sets the specified entry with a specified short value.

Parameters:
value - the value to be stored
index - an index of an entry

setObject

void setObject(JHeapObject object,
               int index)
Sets the specified entry with the reference of the specified object.

Parameters:
object - the object whose the reference value will be stored
index - an index of an entry

setLayout

void setLayout(JArrayLayout layout)
Sets the layout of the array representing by this JArray object. layout describes the relative position of each entry of this array into the memory allocated for it.

Parameters:
layout - the layout describing the entry positions of this array