public class PrimitiveArray extends Parameter implements ArrayParameter, AlignmentAwareParameter
LICENSE_TYPE, V| Constructor and Description |
|---|
PrimitiveArray(byte[] data)
Constructs a byte array and fills it with specified data.
|
PrimitiveArray(byte[] buf,
java.lang.Class entriesClass)
Constructs an array of objects of a specified class and fills it with
corresponding data.
|
PrimitiveArray(java.lang.Class entriesClass,
int count)
Constructs an array and fills it with instances of a specified class.
|
PrimitiveArray(Parameter[] params)
Constructs an array object taking a specified
Parameter
array. |
PrimitiveArray(Parameter sample,
int count)
Constructs an array object.
|
PrimitiveArray(PrimitiveArray t)
Constructs a copy of a specified array.
|
| Modifier and Type | Method and Description |
|---|---|
protected Parameter |
asReturnValue()
Returns a parameter that represents this one as a return value.
|
java.lang.Object |
clone() |
void |
forceElementCount(int elementCount)
Sets a new array size without memory reallocation.
|
void |
fromParameterArray(Parameter[] params)
Sets array contents to the given values.
|
protected int |
getAlignedLength()
Returns a parameter length in bytes aligned to default alignment.
|
int |
getAlignmentRequirement() |
byte[] |
getBytes()
Returns byte data of an array.
|
java.lang.String |
getDebugInfo()
Return debug info for JNIWrapper parameter.
|
Parameter |
getElement(int i)
Returns an array item specified by an index.
|
int |
getElementCount()
Returns the number of elements in the array.
|
java.lang.Class |
getEntryClass()
Returns a class of array items.
|
int |
getFirstMemberSize()
Should return first member size.
|
int |
getLength()
Returns the length of the array data in bytes.
|
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source.
|
void |
readPartially(byte[] arr,
int offset)
Reads raw data from a given array into this object's data source.
|
void |
resizeAndRead(byte[] arr,
int offset,
int dataLength)
Sets a new size of this array and reads it from a given byte array.
|
void |
setElement(int i,
Parameter elem)
Replaces an array item with the specified object.
|
void |
setElementCount(int elementCount)
Resizes this array to a given size.
|
Parameter[] |
toParameterArray()
Returns items as Java array.
|
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source.
|
acceptIOPerformer, dataBufferAssigned, equals, getDataBuffer, getDataBufferOffset, hashCode, indent, pop, push, read, read, setDataBuffer, toByteArray, writepublic PrimitiveArray(PrimitiveArray t)
public PrimitiveArray(java.lang.Class entriesClass,
int count)
entriesClass - Class of array itemscount - Count of array itemspublic PrimitiveArray(byte[] data)
public PrimitiveArray(Parameter sample, int count)
sample - a sample for items in the constructed array.count - count of items in the constructed array.public PrimitiveArray(byte[] buf,
java.lang.Class entriesClass)
public PrimitiveArray(Parameter[] params)
Parameter
array.public java.lang.Class getEntryClass()
public int getLength()
public byte[] getBytes()
public java.lang.String getDebugInfo()
ParametergetDebugInfo in class Parameterpublic Parameter getElement(int i)
ArrayParametergetElement in interface ArrayParameteri - index of a requested array itempublic void setElement(int i,
Parameter elem)
ArrayParametersetElement in interface ArrayParameteri - index of an item to be replacedelem - object to be set as array itempublic int getElementCount()
ArrayParametergetElementCount in interface ArrayParameterpublic Parameter[] toParameterArray()
ArrayParametertoParameterArray in interface ArrayParameterpublic void fromParameterArray(Parameter[] params)
ArrayParameterfromParameterArray in interface ArrayParameterpublic void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterwrite in class ParameterMemoryAccessViolationExceptionpublic void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterread in class ParameterMemoryAccessViolationExceptionpublic void readPartially(byte[] arr,
int offset)
read(byte[] arr, int offset), where data beyond a
given array length in the source array is unspecified.public void resizeAndRead(byte[] arr,
int offset,
int dataLength)
arr - new array raw (as in memory) content.offset - where this parameter starts in arrdataLength - raw length of this array (sizeof(element) *
elementCount)public void forceElementCount(int elementCount)
ArrayParameterforceElementCount in interface ArrayParameterpublic void setElementCount(int elementCount)
ArrayParametersetElementCount in interface ArrayParameterprotected int getAlignedLength()
ParametergetAlignedLength in class Parameterpublic int getAlignmentRequirement()
getAlignmentRequirement in class Parameterprotected Parameter asReturnValue()
ParameterasReturnValue in class Parameterthispublic int getFirstMemberSize()
AlignmentAwareParametergetFirstMemberSize in interface AlignmentAwareParameter