|
|||||||
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.DelegatedArgument
Abstract DelegatedArgument
class represents a base class for all classes
exact value of which is delegated to different object.
Field Summary |
Fields inherited from class com.smardec.j2native.Argument |
JAVA_SIDE, NATIVE_SIDE |
Constructor Summary | |
DelegatedArgument()
|
Method Summary | |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
void |
free()
To avoid memory leaks in native memory should be used this method. |
void |
fromBytesValue(byte[] bytes,
int offset)
Restores itself from provided array of bytes. |
protected int |
getAlignedLength()
Returns aligned to mashine word lenght of the Argument . |
protected Argument |
getInternalValue()
Returns internal Argument object to which all invokes are passed. |
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. |
void |
readFromRAM(long handle,
int offset)
Public method to read Argument from the native memmory. |
protected void |
readFromStack(byte[] stack,
int offset)
Read itself from stack. |
protected void |
restoreFromRAM()
Restores itself from native memory. |
protected void |
setInternalValue(Argument internalValue)
Sets internal Argument object to which all invokes are passed. |
protected long |
storeToRAM()
Stores itself to the native memory. |
byte[] |
toBytesValue()
Encodes itself and returns it's representation as array of bytes. |
void |
toBytesValue(byte[] bytes,
int offset)
Encodes itself to the provided array of bytes. |
protected void |
write(long handle,
int offset)
Writes itself to the memory. |
void |
writeToRAM(long handle,
int offset)
Public method to write Argument to the native memmory. |
protected void |
writeToStack(byte[] stack,
int offset)
Writes itself to stack. |
Methods inherited from class com.smardec.j2native.Argument |
clone, getResultFlags, update |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DelegatedArgument()
Method Detail |
protected Argument getInternalValue()
Argument
object to which all invokes are passed.
protected void setInternalValue(Argument internalValue)
Argument
object to which all invokes are passed.
internalValue
- Argument
object to setpublic byte[] toBytesValue()
Argument
toBytesValue
in class Argument
Argument
public void toBytesValue(byte[] bytes, int offset)
Argument
toBytesValue
in class Argument
bytes
- array of bytes to which Argument
will be writtenoffset
- offset in arraypublic void fromBytesValue(byte[] bytes, int offset)
Argument
fromBytesValue
in class Argument
bytes
- array of bytes from which Argument
will be restoredoffset
- offset in arrayprotected void write(long handle, int offset) throws MemoryException
Argument
write
in class Argument
handle
- identifies location in memory where Argument
will be writtenoffset
- memory address offset
MemoryException
- if memory manipulations or memory access failedprotected void read(long handle, int offset) throws MemoryException
Argument
read
in class Argument
handle
- identifies location in memory from which Argument
will be readoffset
- memory address offset
MemoryException
- if memory manipulations or memory access failedprotected void writeToStack(byte[] stack, int offset)
Argument
writeToStack
in class Argument
stack
- it's byte array, where Argument
will be writtenoffset
- offset in stackprotected void readFromStack(byte[] stack, int offset)
Argument
readFromStack
in class Argument
stack
- it's byte array, from which Argument
will be restoredoffset
- offset in stackpublic int getLength()
Argument
getLength
in class Argument
protected int getAlignedLength()
Argument
Argument
.
getAlignedLength
in class Argument
protected long storeToRAM()
Argument
Argument
takes care of memory allocation and
writes itself to this allocated memory. After all operations complete method returns this memory address.
storeToRAM
in class Argument
protected void restoreFromRAM()
Argument
Argument
should be written to
native memory previously.
restoreFromRAM
in class Argument
public void writeToRAM(long handle, int offset)
Argument
Argument
to the native memmory. This method uses
void write(long handle, int offset)
method to perform operation.
writeToRAM
in class Argument
handle
- identifies location in memory where Argument
will be writtenoffset
- memory address offsetArgument.write(long, int)
public void readFromRAM(long handle, int offset)
Argument
Argument
from the native memmory. This method uses
void read(long handle, int offset)
method to perform operation.
readFromRAM
in class Argument
handle
- identifies location in memory from which Argument
will be readoffset
- memory address offsetArgument.read(long, int)
public void free()
Argument
free
in class Argument
protected void finalize()
Argument
finalize
in class Argument
protected boolean isFixedLength()
Argument
Argument
is a fixed length variable.
isFixedLength
in class Argument
true
if it is so, and false
otherwise
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |