|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jinterop.dcom.core.JIArray
public final class JIArray
Represents a C++ array which can display both conformant and standard behaviors. Since this class forms a wrapper on the actual array, the developer is expected to provide complete and final arrays (of Objects) to this class. Modifying the wrapped array afterwards will have unexpected results.
Please refer to MSExcel examples for more details on how to use this class.
Note: Wrapped Arrays can be at most two dimensional in nature. Above that is not supported by the library.
Constructor Summary | |
---|---|
JIArray(java.lang.Class clazz,
int[] upperBounds,
int dimension,
boolean isConformant)
Creates an array object of the type specified by clazz . |
|
JIArray(java.lang.Class clazz,
int[] upperBounds,
int dimension,
boolean isConformant,
boolean isVarying)
Refer to JIArray(Class, int[], int, boolean) |
|
JIArray(java.lang.Object array)
Creates an object with array parameter as the nested Array. |
|
JIArray(java.lang.Object array,
boolean isConformant)
Creates an object with array parameter as the nested Array. |
|
JIArray(java.lang.Object array,
boolean isConformant,
boolean isVarying)
Refer JIArray(Object, boolean) |
|
JIArray(java.lang.Object template,
int[] upperBounds,
int dimension,
boolean isConformant)
Creates an array object with members of the type template . |
|
JIArray(java.lang.Object template,
int[] upperBounds,
int dimension,
boolean isConformant,
boolean isVarying)
Refer to JIArray(Object, int[], int, boolean) for details. |
Method Summary | |
---|---|
java.lang.Class |
getArrayClass()
Class of the nested Array. |
java.lang.Object |
getArrayInstance()
Returns the nested Array. |
int |
getDimensions()
Returns the dimensions of the Array. |
int[] |
getUpperBounds()
Array of integers depicting highest index for each dimension. |
boolean |
isConformant()
Status whether the array is conformant or not. |
boolean |
isVarying()
Status whether the array is varying or not. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JIArray(java.lang.Class clazz, int[] upperBounds, int dimension, boolean isConformant)
Creates an array object of the type specified by clazz
. This is used
to prepare a template for decoding an array of that type. Used only for setting as an
[out]
parameter in a JICallBuilder.
For example:-
This call creates a template for a single dimension Integer array of size 10.
JIArray array = new JIArray(Integer.class,new int[]{10},1,false);
clazz
- class whose instances will be members of the deserialized array.upperBounds
- highest index for each dimension.dimension
- number of dimensionsisConformant
- declares whether the array is conformant or not.
java.lang.IllegalArgumentException
- if upperBounds
is supplied and its length
is not equal to the dimension
parameter.public JIArray(java.lang.Class clazz, int[] upperBounds, int dimension, boolean isConformant, boolean isVarying)
Refer to JIArray(Class, int[], int, boolean)
clazz
- class whose instances will be members of the deserialized array.upperBounds
- highest index for each dimension.dimension
- number of dimensionsisConformant
- declares whether the array is conformant or not.isVarying
- declares whether the array is varying or not.
java.lang.IllegalArgumentException
- if upperBounds
is supplied and its length
is not equal to the dimension
parameter.public JIArray(java.lang.Object template, int[] upperBounds, int dimension, boolean isConformant)
Creates an array object with members of the type template
.
This constructor is used to prepare a template for decoding an array and is
exclusively for composites like JIStruct
, JIPointer
,
JIUnion
, JIString
where more information on the
structure of the composite is required before trying to deserialize it.
Sample Usage:-
JIStruct safeArrayBounds = new JIStruct();
safeArrayBounds.addMember(Integer.class);
safeArrayBounds.addMember(Integer.class);
//arraydesc
JIStruct arrayDesc = new JIStruct();
//typedesc
JIStruct typeDesc = new JIStruct();
arrayDesc.addMember(typeDesc);
arrayDesc.addMember(Short.class);
arrayDesc.addMember(new JIArray(safeArrayBounds,new int[]{1},1,true));
template
- can be only of the type JIStruct
, JIPointer
,
JIUnion
, JIString
upperBounds
- highest index for each dimension.dimension
- number of dimensionsisConformant
- declares whether the array is conformant or not.
java.lang.IllegalArgumentException
- if upperBounds
is supplied and its length
is not equal to the dimension
parameter.
java.lang.IllegalArgumentException
- if template
is null or is not of the
specified types.public JIArray(java.lang.Object template, int[] upperBounds, int dimension, boolean isConformant, boolean isVarying)
Refer to JIArray(Object, int[], int, boolean)
for details.
template
- can be only of the type JIStruct
, JIPointer
,
JIUnion
, JIString
upperBounds
- highest index for each dimension.dimension
- number of dimensionsisConformant
- declares whether the array is conformant or not.isVarying
- declares whether the array is varying or not.
java.lang.IllegalArgumentException
- if upperBounds
is supplied and its length
is not equal to the dimension
parameter.
java.lang.IllegalArgumentException
- if template
is null or is not of the
specified types.public JIArray(java.lang.Object array, boolean isConformant)
Creates an object with array parameter as the nested Array. This constructor is used when the developer wants to send an array to COM server.
Sample Usage :-
JIArray array = new JIArray(new JIString[]{new JIString(name)},true);
array
- Array of any type. Primitive arrays are not allowed.isConformant
- declares whether the array is conformant
or not.
java.lang.IllegalArgumentException
- if the array
is not an array or
is of primitive type or is an array of java.lang.Object
.public JIArray(java.lang.Object array, boolean isConformant, boolean isVarying)
JIArray(Object, boolean)
array
- Array of any type. Primitive arrays are not allowed.isConformant
- declares whether the array is conformant
or not.isVarying
- declares whether the array is varying
or not.
java.lang.IllegalArgumentException
- if the array
is not an array or
is of primitive type or is an array of java.lang.Object
.public JIArray(java.lang.Object array)
Creates an object with array parameter as the nested Array.
This constructor forms a non-conformant
array and is used
when the developer wants to send an array to COM server.
Sample Usage :-
JIArray array = new JIArray(new JIString[]{new JIString(name)},true);
array
- Array of any type. Primitive arrays are not allowed.
java.lang.IllegalArgumentException
- if the array
is not an array or
is of primitive type or is an array of java.lang.Object
.Method Detail |
---|
public java.lang.Object getArrayInstance()
getArrayClass()
.public java.lang.Class getArrayClass()
class
public int[] getUpperBounds()
int[]
public int getDimensions()
int
public boolean isConformant()
conformant
or not.
true
is array is conformant
.public boolean isVarying()
varying
or not.
true
is array is varying
.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |