|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.smardec.j2native.Argument
|
+--com.smardec.j2native.ArrayArgument
ArrayArgument class 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.smardec.j2native.Argument |
JAVA_SIDE, NATIVE_SIDE |
| Constructor Summary | |
ArrayArgument(Argument[] elements)
Constructs an array object taking a specified Argument array. |
|
ArrayArgument(Argument sample,
int arrayLength)
Constructs an array object of specified length. |
|
ArrayArgument(java.lang.Class arrayType,
int arrayLength)
Constructs an array of objects of a specified class and size. |
|
| Method Summary | |
void |
fromArgumentsArray(Argument[] arguments)
Sets array contents to the given values. |
void |
fromBytesValue(byte[] bytes,
int offset)
Restores itself from provided array of bytes. |
Argument |
getElement(int index)
Returns an array item specified by an index. |
int |
getElementsCount()
Returns the number of elements in the array. |
int |
getLength()
Returns length in bytes. |
protected boolean |
isFixedLength()
Identify if Argument is a fixed length variable. |
protected void |
read(long handle,
int offset)
Reads itself from the memory. |
protected void |
readFromStack(byte[] stack,
int offset)
Read itself from stack. |
void |
setElement(int index,
Argument argument)
Replaces an array item with the specified object. |
void |
setElementsCount(int newLength)
Resizes this array to a given size. |
Argument[] |
toArgumentsArray()
Returns items as Java array. |
byte[] |
toBytesValue()
Encodes itself and returns it's representation as array of bytes. |
protected void |
toBytesValue(byte[] bytes,
int offset)
Encodes itself to the provided array of bytes. |
protected void |
update(byte side)
This method is used to synchronize Java side and native part. |
protected void |
write(long handle,
int offset)
Writes itself to the memory. |
protected void |
writeToStack(byte[] stack,
int offset)
Writes itself to stack. |
| Methods inherited from class com.smardec.j2native.Argument |
clone, finalize, free, getAlignedLength, getResultFlags, readFromRAM, restoreFromRAM, storeToRAM, writeToRAM |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArrayArgument(java.lang.Class arrayType,
int arrayLength)
null), so you have to do it
arrayType - class for items in the constructed arrayarrayLength - count of items in the constructed array
public ArrayArgument(Argument sample,
int arrayLength)
null),
so you have to do it.
sample - a sample for items in the constructed arrayarrayLength - count of items in the constructed arraypublic ArrayArgument(Argument[] elements)
Argument array.
elements - Argument[] array ot the new values| Method Detail |
public Argument getElement(int index)
ArrayType
getElement in interface ArrayTypeindex - index of a requested array item
Argument item
public void setElement(int index,
Argument argument)
throws java.lang.ArrayStoreException
ArrayType
setElement in interface ArrayTypeindex - index of an item to be replacedargument - object to be set as array item
java.lang.ArrayStoreExceptionpublic int getElementsCount()
ArrayType
getElementsCount in interface ArrayTypepublic void setElementsCount(int newLength)
ArrayType
setElementsCount in interface ArrayTypenewLength - new array sizepublic Argument[] toArgumentsArray()
ArrayType
toArgumentsArray in interface ArrayTypeArgument[]public void fromArgumentsArray(Argument[] arguments)
ArrayType
fromArgumentsArray in interface ArrayTypearguments - Argument[] array ot the new values
protected void writeToStack(byte[] stack,
int offset)
Argument
writeToStack in class Argumentstack - it's byte array, where Argument will be writtenoffset - offset in stack
protected void readFromStack(byte[] stack,
int offset)
Argument
readFromStack in class Argumentstack - it's byte array, from which Argument will be restoredoffset - offset in stackpublic int getLength()
Argument
getLength in class Argumentpublic byte[] toBytesValue()
Argument
toBytesValue in class ArgumentArgument
protected void toBytesValue(byte[] bytes,
int offset)
Argument
toBytesValue in class Argumentbytes - array of bytes to which Argument will be writtenoffset - offset in array
public void fromBytesValue(byte[] bytes,
int offset)
Argument
fromBytesValue in class Argumentbytes - array of bytes from which Argument will be restoredoffset - offset in array
protected void write(long handle,
int offset)
throws MemoryException
Argument
write in class Argumenthandle - identifies location in memory where Argument
will be writtenoffset - memory address offset
MemoryException - if memory manipulations or memory access failed
protected void read(long handle,
int offset)
throws MemoryException
Argument
read in class Argumenthandle - identifies location in memory from which Argument
will be readoffset - memory address offset
MemoryException - if memory manipulations or memory access failedprotected void update(byte side)
Argument
update in class Argumentside - identifies part that should be updatedprotected boolean isFixedLength()
ArgumentArgument is a fixed length variable.
isFixedLength in class Argumenttrue if it is so, and false otherwise
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||