|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jniwrapper.Parameter com.jniwrapper.win32.automation.types.SafeArray
This class is the special helper class for working with SafeArray.SafeArrayStructure
, which corresponds
to the SAFEARRAY
data type. Instance of SafeArray
can be considered as the pointer to
the SafeArrayStructure
structure. -breakiterator
NOTE: the instance of this class is freed automatically, by the NativeResourceCollector
if there is no
more locks for a given instance.
Nested Class Summary | |
static class |
SafeArray.SafeArrayAttributes
|
class |
SafeArray.SafeArrayStructure
This class represents SAFEARRAY Data Type. |
Field Summary |
Fields inherited from class com.jniwrapper.Parameter |
LICENSE_TYPE, V |
Constructor Summary | |
SafeArray()
Initializes empty instance. |
|
SafeArray(byte[] bytes)
Creates the array of bytes ( UInt8 ) directly from the specified Java byte array. |
|
SafeArray(java.lang.Class parameterClass)
Initializes a new instance of safe array of elements, specified by parameterClass parameter. |
|
SafeArray(double[] array)
Creates a SafeArray of DoubleFloat elements from a specified array of double's. |
|
SafeArray(float[] array)
Creates a SafeArray of Float elements from a specified array of float's. |
|
SafeArray(int[] array)
Creates a SafeArray of Int elements from a specified array of int's. |
|
SafeArray(int[] counts,
java.lang.Class parameterClass)
Creates multidimensional array for specified data type and the specified array bounds of SafeArrayBound type. |
|
SafeArray(int count,
java.lang.Class parameterClass)
Creates one-dimensional array for specified data type and element counts. |
|
SafeArray(int count,
int lowerBound,
java.lang.Class parameterClass)
Creates one-dimensional array for specified data type, lower bound and element counts. |
|
SafeArray(long[] array)
Creates a SafeArray of LongInt elements from a specified array of long's. |
|
SafeArray(Parameter[] array)
Creates a SafeArray object from a specified array of parameters. |
|
SafeArray(Pointer.Void psa,
java.lang.Class parameterClass)
Constructs an array from a pointer |
|
SafeArray(SafeArrayBound[] bounds,
byte[] bytes)
Creates the array of bytes ( UInt8 ) directly from the specified Java byte array. |
|
SafeArray(SafeArrayBound[] bounds,
byte[] bytes,
java.lang.Class parameterClass)
Creates the array of bytes directly from the specified Java byte array. |
|
SafeArray(SafeArrayBound[] bounds,
java.lang.Class parameterClass)
Creates multi-dimensional array for specified data type and the specified array bounds of SafeArrayBound type. |
|
SafeArray(SafeArrayBound bound,
java.lang.Class parameterClass)
Creates one-dimensional array for specified data type and the specified array bound of SafeArrayBound type. |
|
SafeArray(java.lang.String[] array)
Creates a SafeArray of BStr elements from a specified array of strings. |
Method Summary | |
void |
acceptIOPerformer(IOPerformer performer,
DataBuffer buffer,
int initialOffset,
boolean isReadOperation,
boolean invokedByCallback)
|
void |
changeSize(int newSize)
Changes array size (only last dimension can be changed) |
java.lang.Object |
clone()
|
void |
create(byte[] bytes)
Creates the array of bytes ( UInt8 ) directly from the specified Java byte array. |
void |
create(int[] counts,
java.lang.Class parameterClass)
Creates multidimensional array for specified data type and the specified array bounds of SafeArrayBound type. |
void |
create(int count,
java.lang.Class parameterClass)
Creates one-dimensional array for specified data type and element counts. |
void |
create(int count,
int lowerBound,
java.lang.Class parameterClass)
Creates one-dimensional array for specified data type, lower bound and element counts. |
protected void |
create(SafeArrayBound bound)
|
protected void |
create(SafeArrayBound[] bounds)
|
void |
create(SafeArrayBound[] bounds,
byte[] bytes)
Creates the array of bytes ( UInt8 ) directly from the specified Java byte array. |
void |
create(SafeArrayBound[] bounds,
byte[] bytes,
java.lang.Class parameterClass)
Creates the array of bytes directly from the specified Java byte array. |
void |
create(SafeArrayBound[] bounds,
java.lang.Class parameterClass)
Creates multidimensional array for specified data type and the specified array bounds of SafeArrayBound type. |
void |
create(SafeArrayBound bound,
java.lang.Class parameterClass)
Creates one-dimensional array for specified data type and the specified array bound of SafeArrayBound type. |
Parameter |
get(int index)
Returns an element of the one-dimensional array by the specified index. |
Parameter |
get(int[] indices)
Returns an element of the multi-dimensional array by the specified indices. |
Parameter |
get(int[] indices,
boolean useAPI)
Returns an element of the multi-dimensional array by the specified indices. |
ComplexArray |
getBounds()
Returns the bounds of the complex array. |
byte[] |
getBytes()
Retrieves Java byte array from this array. |
int |
getCount()
Returns the number of elements in the one-dimensional array. |
int |
getCount(int dims)
Returns the number of elements in the multi-dimensional array. |
ExternalArrayPointer |
getData()
Returns the pointer to the data. |
java.lang.String |
getDebugInfo()
|
int |
getDimensions()
Returns the number of dimensions in the array. |
SafeArray.SafeArrayAttributes |
getFeatures()
|
long |
getHandle()
Returns the address of this SafeArray object. |
int |
getLength()
Returns the length of SafeArray parameter. |
int |
getLocks()
Returns number of locks on this array. |
int |
getLowerBound()
Returns the lower bound of the array. |
int |
getLowerBound(int dims)
Returns the lower bound of the array with specified numbers of dimensions. |
static VarType |
getSafeArrayType(Parameter psa)
Determines VarType of a specified safe array parameter |
int |
getUpperBound()
Returns the upper bound of the array. |
int |
getUpperBound(int dims)
Returns the upper bound of the array with specified numbers of dimensions. |
int |
getVarType()
Returns the type of data, stored in the array. |
boolean |
isAutoDelete()
Returns true if resource is auto deleteable else return false. |
boolean |
isNull()
Check if this object is null. |
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
|
void |
release()
Releases native resources of this object. |
void |
set(int[] indices,
Parameter value)
Sets the element at a given index in the multi-dimensional array. |
void |
set(int[] indices,
Parameter value,
boolean useAPI)
Sets the element at a given index in the multi-dimensional array. |
void |
set(int index,
Parameter value)
Sets the element at a given index in the one-dimensional array. |
void |
setAutoDelete(boolean isAutoDelete)
Make resource auto deleteable or manually deleteable. |
protected void |
setHandle(long value)
|
void |
unlock()
|
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
|
Methods inherited from class com.jniwrapper.Parameter |
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SafeArray()
public SafeArray(java.lang.Class parameterClass)
parameterClass
parameter. -breakiterator
NOTE: This constructor does not create the instance on the native side.
parameterClass
- specifies elements to be stored in the safe array.public SafeArray(int count, int lowerBound, java.lang.Class parameterClass)
count
- element count.lowerBound
- lower bound.parameterClass
- data type srored in the safe array.public SafeArray(int count, java.lang.Class parameterClass)
count
- element count.parameterClass
- data type srored in the safe array.public SafeArray(SafeArrayBound bound, java.lang.Class parameterClass)
SafeArrayBound
type.
bound
- bound for the array.parameterClass
- data type srored in the safe array.public SafeArray(Parameter[] array)
array
- of parameters. All elements of array should be initialized and should have the same type.public SafeArray(java.lang.String[] array)
BStr
elements from a specified array of strings.
array
- string arraypublic SafeArray(int[] array)
Int
elements from a specified array of int's.
array
- array of int'spublic SafeArray(long[] array)
LongInt
elements from a specified array of long's.
array
- array of long'spublic SafeArray(float[] array)
Float
elements from a specified array of float's.
array
- array of float'spublic SafeArray(double[] array)
DoubleFloat
elements from a specified array of double's.
array
- array of double'spublic SafeArray(SafeArrayBound[] bounds, java.lang.Class parameterClass)
SafeArrayBound
type.
bounds
- array of bounds for the multi-dimensional array.parameterClass
- data type srored in the safe array.public SafeArray(int[] counts, java.lang.Class parameterClass)
SafeArrayBound
type.
counts
- number of elements in each bound for the multi-dimensional array.parameterClass
- data type srored in the safe array.public SafeArray(byte[] bytes)
UInt8
) directly from the specified Java byte array.
bytes
- bytes to be stored in the resulting arraypublic SafeArray(SafeArrayBound[] bounds, byte[] bytes)
UInt8
) directly from the specified Java byte array.
bounds
- multidimensional array boundsbytes
- bytes to be stored in the resulting arraypublic SafeArray(SafeArrayBound[] bounds, byte[] bytes, java.lang.Class parameterClass)
bounds
- multidimensional array boundsbytes
- bytes to be stored in the resulting arrayparameterClass
- specifies the class of parameterspublic SafeArray(Pointer.Void psa, java.lang.Class parameterClass)
psa
- pointer to a safe arrayparameterClass
- type of data in the safe arrayMethod Detail |
public void create(int count, int lowerBound, java.lang.Class parameterClass)
count
- element count.lowerBound
- lower bound.parameterClass
- data type srored in the safe array.public void create(int count, java.lang.Class parameterClass)
count
- element count.parameterClass
- data type srored in the safe array.public void create(SafeArrayBound bound, java.lang.Class parameterClass)
SafeArrayBound
type.
This method destroys previous array content, if that one is allocated before.
bound
- bound for the array.parameterClass
- data type srored in the safe array.public void create(SafeArrayBound[] bounds, java.lang.Class parameterClass)
SafeArrayBound
type.
This method destroys previous array content, if that one is allocated before.
bounds
- array of bounds for the multi-dimensional array.parameterClass
- data type srored in the safe array.public void create(int[] counts, java.lang.Class parameterClass)
SafeArrayBound
type.
This method destroys previous array content, if that one is allocated before.
counts
- number of elements in each bound for the multi-dimensional array.parameterClass
- data type srored in the safe array.public void create(byte[] bytes)
UInt8
) directly from the specified Java byte array.
This method destroys previous array content, if that one is allocated before.
bytes
- bytes to be stored in the resulting arraypublic void create(SafeArrayBound[] bounds, byte[] bytes)
UInt8
) directly from the specified Java byte array.
This method destroys previous array content, if that one is allocated before.
bounds
- multidimensional array boundsbytes
- bytes to be stored in the resulting arraypublic void create(SafeArrayBound[] bounds, byte[] bytes, java.lang.Class parameterClass)
bounds
- multidimensional array boundsbytes
- bytes to be stored in the resulting arrayparameterClass
- specifies the class of parameterspublic void acceptIOPerformer(IOPerformer performer, DataBuffer buffer, int initialOffset, boolean isReadOperation, boolean invokedByCallback)
public long getHandle()
SafeArray
object.
SafeArray
object.protected void setHandle(long value)
public ComplexArray getBounds()
public boolean isNull()
isNull
in interface PointerParameter
public int getVarType()
VarType
.
public SafeArray.SafeArrayAttributes getFeatures()
public ExternalArrayPointer getData()
public void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
MemoryAccessViolationException
public void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
MemoryAccessViolationException
public int getLength()
public java.lang.String getDebugInfo()
public byte[] getBytes()
public java.lang.Object clone()
protected void create(SafeArrayBound bound)
protected void create(SafeArrayBound[] bounds)
public int getLowerBound()
public int getLowerBound(int dims)
dims
- specifies the number of dimensions.
public int getUpperBound()
public int getUpperBound(int dims)
dims
- specifies the number of dimensions.
public int getCount()
public int getCount(int dims)
dims
- specifies the number of dimensions.
public int getDimensions()
public void changeSize(int newSize)
newSize
- new size of arraypublic void setAutoDelete(boolean isAutoDelete)
setAutoDelete
in interface AutoDeleteParameter
isAutoDelete
- if true then resource becomes auto deleteable else you need to delete it manually.public boolean isAutoDelete()
isAutoDelete
in interface AutoDeleteParameter
public void unlock()
public void release()
public Parameter get(int index)
index
- index in one-dimensional array.
public void set(int index, Parameter value)
index
- index in one-dimensional array.value
- data to set.public Parameter get(int[] indices)
indices
- indexes for each dimension of the array.
The right-most (least significant) dimension is indices[0]
.
The left-most dimension is stored at indices[cDims � 1]
.
public Parameter get(int[] indices, boolean useAPI)
indices
- indexes for each dimension of the array.
The right-most (least significant) dimension is indices[0]
.
The left-most dimension is stored at indices[cDims � 1]
.useAPI
- get element via API call instead of direct reading from memory
public void set(int[] indices, Parameter value)
indices
- indexes for each dimension of the array. The right-most (least significant) dimension is indices[0]. The left-most dimension is stored at indices[cDims � 1].value
- data to assign to the array.public void set(int[] indices, Parameter value, boolean useAPI)
indices
- indexes for each dimension of the array. The right-most (least significant) dimension is indices[0]. The left-most dimension is stored at indices[cDims � 1].value
- data to assign to the array.useAPI
- get element via API call instead of direct reading from memorypublic int getLocks()
public static VarType getSafeArrayType(Parameter psa)
VarType
of a specified safe array parameter
psa
- safeArray poitner
VarType
of the safe array
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |