|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.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.
Constructor Summary | |
PrimitiveArray(byte[] data)
Constructs byte array and fills it with specified data. |
|
PrimitiveArray(byte[] buf,
java.lang.Class entriesClass)
Constructs array of objects of specified class and fills it with corresponding data. |
|
PrimitiveArray(java.lang.Class entriesClass,
int count)
Constructs an array and fills it with instances of specified class. |
|
PrimitiveArray(Parameter[] params)
Constructs array object taking specified Parameter array. |
|
PrimitiveArray(Parameter sample,
int count)
Constructs array object. |
|
PrimitiveArray(PrimitiveArray t)
Constructs a copy of specified array. |
Method Summary | |
java.lang.Object |
clone()
|
void |
forceElementCount(int elementCount)
Sets new array size without memory reallocation. |
void |
fromParameterArray(Parameter[] params)
Sets array content to the given values. |
byte[] |
getBytes()
Returns byte data of an array. |
Parameter |
getElement(int i)
Returns 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 |
getLength()
Returns length of the array data in bytes. |
void |
read(DataBuffer stackBuffer,
int offset)
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 new size of this array and reads it from given byte array. |
void |
setElement(int i,
Parameter elem)
Replaces array item with the specified object. |
void |
setElementCount(int elementCount)
Resizes this array to a given size. |
Parameter[] |
toParameterArray()
Returns items as Java array. |
java.lang.String |
toString()
|
void |
write(DataBuffer stackBuffer,
int offset)
Writes this parameter to a specified data source. |
Methods inherited from class com.jniwrapper.Parameter |
acceptIOPerformer, asReturnValue, equals, getAlignedLength, getBuffer, getOffset, indent, pop, push, read, setBuffer, toByteArray, write |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, 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
- Sample for items in constructed arraycount
- Count of items in constructed arraypublic 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 Parameter
public byte[] getBytes()
public java.lang.Object clone()
clone
in class Parameter
public java.lang.String toString()
toString
in class java.lang.Object
public Parameter getElement(int i)
ArrayParameter
getElement
in interface ArrayParameter
i
- index of requested array itempublic void setElement(int i, Parameter elem)
ArrayParameter
setElement
in interface ArrayParameter
i
- index of an item to be replacedelem
- object to be set as array itempublic int getElementCount()
ArrayParameter
getElementCount
in interface ArrayParameter
public Parameter[] toParameterArray()
ArrayParameter
toParameterArray
in interface ArrayParameter
public void fromParameterArray(Parameter[] params)
ArrayParameter
fromParameterArray
in interface ArrayParameter
public void write(DataBuffer stackBuffer, int offset) throws MemoryAccessViolationException
Parameter
write
in class Parameter
MemoryAccessViolationException
public void read(DataBuffer stackBuffer, int offset) throws MemoryAccessViolationException
Parameter
read
in class Parameter
MemoryAccessViolationException
public void readPartially(byte[] arr, int offset)
read(byte[] arr, int offset)
where data beyond given array length
in source array is unspecified.
public void resizeAndRead(byte[] arr, int offset, int dataLength)
arr
- new array raw (as in memory) contents.offset
- where this parameter starts in arr
dataLength
- raw length of this array (sizeof(element) * elementCount)public void forceElementCount(int elementCount)
ArrayParameter
forceElementCount
in interface ArrayParameter
public void setElementCount(int elementCount)
ArrayParameter
setElementCount
in interface ArrayParameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |