OVERONE.DotNetJ
Class JavaArray

Objects of this class stand for remote Java arrays in the Dynamic Invocation Interface (DII) API. Allows to access, modify elements of Java arrays. Use the public constructor to instantiate a remote Java array.

Field Summary
bool MustUpdate
         Indicates wether the local array needs to updated regarding to the remote Java array.

Constructor Summary
JavaArray(string channelUrl, string elementType, int[] lengths)
         Instantiates a remote Java array with the specified element type and length.

Property Summary
object Item[int index]
         The element at the specified index. Is either of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.
object Item[int index1, int index2]
         The element at the specified index if the array is bidimensional. Is either of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.
object Item[int index1, int index2, int index3]
         The element at the specified index if the array is tridimensional. Is either of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.
int Length
         The array length.
int[] Lengths
         The dimensions' lengths of the array.
byte Rank
         The array rank (number of dimensions).

Method Summary
int GetLength(int dimension)
         Returns the array length for the specified dimension.
object GetValue(int[] indices)
         Gets the element at the specified index if the array is multidimensional.
void SetValue(object val, int[] indices)
         Sets the element at the specified index if the array is multidimensional.
void UpdateLocal()
         Updates the local array so that its elements reflect the remote Java array's elements.

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

MustUpdate

public bool MustUpdate

Indicates wether the local array needs to updated regarding to the remote Java array.

Constructor Detail

JavaArray

public JavaArray(string channelUrl,
                 string elementType,
                 int[] lengths)

Instantiates a remote Java array with the specified element type and length.

Parameters:
channelUrl - The network location where the Java object must be instantiated, must be of the form java://host:port or java://host. If no port is specified, the default port is used.
elementType - The Java array element type name. Use a Java class name, or a predefined type name with OVERONE.DotNetJ.ParameterTypeNames.
lengths - The aray length.
Property Detail

Item

public object this[int index]

The element at the specified index. Is either of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.


Item

public object this[int index1,
                   int index2]

The element at the specified index if the array is bidimensional. Is either of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.


Item

public object this[int index1,
                   int index2,
                   int index3]

The element at the specified index if the array is tridimensional. Is either of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.


Length

public int Length

The array length.


Lengths

public int[] Lengths

The dimensions' lengths of the array.


Rank

public byte Rank

The array rank (number of dimensions).

Method Detail

GetLength

public int GetLength(int dimension)

Returns the array length for the specified dimension.

Parameters:
dimension - The dimension of whom the length is returned.
Returns:

GetValue

public object GetValue(int[] indices)

Gets the element at the specified index if the array is multidimensional.

Parameters:
indices - The indices of the element.
Returns:
Either an object of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.

SetValue

public void SetValue(object val,
                     int[] indices)

Sets the element at the specified index if the array is multidimensional.

Parameters:
val - The value of the element to set. Pass either an object of a .NET primitive type or a OVERONE.DotNetJ.JavaObject.
indices - The indices of the element.

UpdateLocal

public void UpdateLocal()

Updates the local array so that its elements reflect the remote Java array's elements.