Klasse OaIdl.SAFEARRAY
- Alle implementierten Schnittstellen:
Closeable
,AutoCloseable
- Bekannte direkte Unterklassen:
OaIdl.SAFEARRAY.ByReference
- Umschließende Schnittstelle:
OaIdl
VARTYPE for the SAFEARRAY can be:
- VT_BOOL
- VT_BSTR
- VT_CY
- VT_DATE
- VT_DECIMAL
- VT_DISPATCH
- VT_ERROR
- VT_I1
- VT_I2
- VT_I4
- VT_INT
- VT_R4
- VT_R8
- VT_RECORD
- VT_UI1
- VT_UI2
- VT_UI4
- VT_UINT
- VT_UNKNOWN
- VT_VARIANT
General comment: All indices in the helper methods use java int.
The native type for the indices is LONG, which is defined as:
A 32-bit signed integer. The range is �2147483648 through 2147483647 decimal.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen com.sun.jna.Structure
Structure.ByValue, Structure.FieldOrder, Structure.StructField
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungThe rgsabound.Von Klasse geerbte Felder com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungLock array and retrieve pointer to datavoid
close()
Implemented to satisfy Closeable interface, delegates to destroy.static OaIdl.SAFEARRAY.ByReference
createSafeArray
(int... size) Create a SAFEARRAY with supplied VARIANT as element type.static OaIdl.SAFEARRAY.ByReference
createSafeArray
(WTypes.VARTYPE vartype, int... size) Create a SAFEARRAY with supplied element type.void
destroy()
Destroy the underlying SAFEARRAY and free memoryint
Return number of dimensions of the SAFEARRAYgetElement
(int... indices) Retrieve the value at the referenced index from the SAFEARRAY.long
Get size of one element in bytesint
getLBound
(int dimension) Retrieve lower bound for the selected dimension.int
getUBound
(int dimension) Retrieve upper bound for the selected dimension.Return VARTYPE of the SAFEARRAYvoid
lock()
Increments the lock count of an array, and places a pointer to the array data in pvData of the array descriptor.ptrOfIndex
(int... indices) Retrieve pointer to data element from array.void
putElement
(Object arg, int... indices) Set value atindices
inarray
to arg.void
read()
Reads the fields of the struct from native memoryvoid
redim
(int cElements, int lLbound) Changes the right-most (least significant) bound of the specified safe array.void
Unlock array and invalidate the pointer retrieved via SafeArrayAccessDatavoid
unlock()
Decrements the lock count of an array so it can be freed or resizedVon Klasse geerbte Methoden com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFieldOrder, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
Felddetails
-
cDims
-
fFeatures
-
cbElements
-
cLocks
-
pvData
-
rgsabound
The rgsabound.
-
-
Konstruktordetails
-
SAFEARRAY
public SAFEARRAY() -
SAFEARRAY
-
-
Methodendetails
-
read
public void read()Beschreibung aus Klasse kopiert:Structure
Reads the fields of the struct from native memory -
createSafeArray
Create a SAFEARRAY with supplied VARIANT as element type.This helper creates a basic SAFEARRAY with a base type of VT_VARIANT. The array will have as many dimensions as parameters are passed in. The lowerbound for each dimension is set to zero, the count to the parameter value.
- Parameter:
size
- array of dimension size- Gibt zurück:
- SAFEARRAYWrapper or
NULL
if creation fails.
-
createSafeArray
Create a SAFEARRAY with supplied element type.The array will have as many dimensions as parameters are passed in. The lowerbound for each dimension is set to zero, the count to the parameter value.
- Parameter:
vartype
- type of array contents (see Variant.VT_* constants)size
- array of dimension size- Gibt zurück:
- SAFEARRAYWrapper or
NULL
if creation fails.
-
putElement
Set value atindices
inarray
to arg.The supplied argument is copied into the array. If the value is no longer needed, it needs to be freed if not handled automatically.
- Parameter:
arg
- the argindices
- the index, order follows java/C convention
-
getElement
Retrieve the value at the referenced index from the SAFEARRAY.The function creates a copy of the value. The values are allocated with native functions and need to be freed accordingly.
- Parameter:
indices
- the index, order follows java/C convention- Gibt zurück:
- the variant
-
ptrOfIndex
Retrieve pointer to data element from array.Caller is responsible for (un)locking the array via
OleAuto.SafeArrayLock(com.sun.jna.platform.win32.OaIdl.SAFEARRAY)
andOleAuto.SafeArrayUnlock(com.sun.jna.platform.win32.OaIdl.SAFEARRAY)
or the helper methods:lock()
andunlock()
.- Parameter:
indices
- the index, order follows java/C convention- Gibt zurück:
- the pointer to the data element
-
destroy
public void destroy()Destroy the underlying SAFEARRAY and free memory -
close
public void close()Implemented to satisfy Closeable interface, delegates to destroy.- Angegeben von:
close
in SchnittstelleAutoCloseable
- Angegeben von:
close
in SchnittstelleCloseable
-
getLBound
public int getLBound(int dimension) Retrieve lower bound for the selected dimension.As in the all the accessor functions, that index is converted to java conventions.
- Parameter:
dimension
- zerobased index- Gibt zurück:
- lower bound for the selected dimension
-
getUBound
public int getUBound(int dimension) Retrieve upper bound for the selected dimension.As in the all the accessor functions, that index is converted to java conventions.
- Parameter:
dimension
- zerobased index- Gibt zurück:
- upper bound for the selected dimension
-
getDimensionCount
public int getDimensionCount()Return number of dimensions of the SAFEARRAY- Gibt zurück:
- number of dimensions of the SAFEARRAY
-
accessData
Lock array and retrieve pointer to data- Gibt zurück:
- Pointer to arraydata
-
unaccessData
public void unaccessData()Unlock array and invalidate the pointer retrieved via SafeArrayAccessData -
lock
public void lock()Increments the lock count of an array, and places a pointer to the array data in pvData of the array descriptor. -
unlock
public void unlock()Decrements the lock count of an array so it can be freed or resized -
redim
public void redim(int cElements, int lLbound) Changes the right-most (least significant) bound of the specified safe array.- Parameter:
cElements
-lLbound
-
-
getVarType
Return VARTYPE of the SAFEARRAY- Gibt zurück:
- VARTYPE of the SAFEARRAY
-
getElemsize
public long getElemsize()Get size of one element in bytes- Gibt zurück:
- element size in bytes
-