|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jniwrapper.Parameter
com.jniwrapper.PrimitiveArray
Represents an array of primitive types such as array of bytes or array of integer values. All array items are instances of the same class.
| Field Summary |
| Fields inherited from class com.jniwrapper.Parameter |
LICENSE_TYPE, V |
| Constructor Summary | |
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. |
|
| Method Summary | |
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. |
| Methods inherited from class com.jniwrapper.Parameter |
acceptIOPerformer, dataBufferAssigned, equals, getDataBuffer, getDataBufferOffset, hashCode, indent, pop, push, read, read, setDataBuffer, toByteArray, write |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public 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.
| Method Detail |
public java.lang.Class getEntryClass()
public int getLength()
getLength in class Parameterpublic byte[] getBytes()
public java.lang.Object clone()
clone in class Parameterpublic java.lang.String getDebugInfo()
Parameter
getDebugInfo in class Parameterpublic Parameter getElement(int i)
ArrayParameter
getElement in interface ArrayParameteri - index of a requested array item
public void setElement(int i,
Parameter elem)
ArrayParameter
setElement in interface ArrayParameteri - index of an item to be replacedelem - object to be set as array itempublic int getElementCount()
ArrayParameter
getElementCount in interface ArrayParameterpublic Parameter[] toParameterArray()
ArrayParameter
toParameterArray in interface ArrayParameterpublic void fromParameterArray(Parameter[] params)
ArrayParameter
fromParameterArray in interface ArrayParameter
public void write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
write in class ParameterMemoryAccessViolationException
public void read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
read in class ParameterMemoryAccessViolationException
public 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)
ArrayParameter
forceElementCount in interface ArrayParameterpublic void setElementCount(int elementCount)
ArrayParameter
setElementCount in interface ArrayParameterprotected int getAlignedLength()
Parameter
getAlignedLength in class Parameterpublic int getAlignmentRequirement()
getAlignmentRequirement in class Parameterprotected Parameter asReturnValue()
Parameter
asReturnValue in class Parameterthispublic int getFirstMemberSize()
AlignmentAwareParameter
getFirstMemberSize in interface AlignmentAwareParameter
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||