com.smardec.j2native
Class PointerArgument

java.lang.Object
  |
  +--com.smardec.j2native.Argument
        |
        +--com.smardec.j2native.PointerArgument
All Implemented Interfaces:
java.lang.Cloneable, PointerType
Direct Known Subclasses:
Pointer.Void, TypedPointer

public abstract class PointerArgument
extends Argument
implements PointerType

PointerArgument is an abstract class with a partly realized PointerType interface. This class is a base class for all pointer types.


Field Summary
 
Fields inherited from class com.smardec.j2native.Argument
JAVA_SIDE, NATIVE_SIDE
 
Constructor Summary
PointerArgument()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void fromBytesValue(byte[] bytes, int offset)
          Restores itself from provided array of bytes.
 int getLength()
          Returns length in bytes.
 int hashCode()
           
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.
 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.
protected  void writeToStack(byte[] stack, int offset)
          Writes itself to stack.
 
Methods inherited from class com.smardec.j2native.Argument
clone, finalize, free, getAlignedLength, readFromRAM, restoreFromRAM, storeToRAM, update, writeToRAM
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.smardec.j2native.PointerType
getReferencedArgument, getValue, isNull, setValue
 

Constructor Detail

PointerArgument

public PointerArgument()
Method Detail

getLength

public int getLength()
Description copied from class: Argument
Returns length in bytes.

Specified by:
getLength in class Argument
Returns:
an int

writeToStack

protected void writeToStack(byte[] stack,
                            int offset)
Description copied from class: Argument
Writes itself to stack.

Specified by:
writeToStack in class Argument
Parameters:
stack - it's byte array, where Argument will be written
offset - offset in stack

readFromStack

protected void readFromStack(byte[] stack,
                             int offset)
Description copied from class: Argument
Read itself from stack.

Specified by:
readFromStack in class Argument
Parameters:
stack - it's byte array, from which Argument will be restored
offset - offset in stack

toBytesValue

public byte[] toBytesValue()
Description copied from class: Argument
Encodes itself and returns it's representation as array of bytes.

Specified by:
toBytesValue in class Argument
Returns:
byte[] representation of Argument

toBytesValue

public void toBytesValue(byte[] bytes,
                         int offset)
Description copied from class: Argument
Encodes itself to the provided array of bytes.

Specified by:
toBytesValue in class Argument
Parameters:
bytes - array of bytes to which Argument will be written
offset - offset in array

fromBytesValue

public void fromBytesValue(byte[] bytes,
                           int offset)
Description copied from class: Argument
Restores itself from provided array of bytes.

Specified by:
fromBytesValue in class Argument
Parameters:
bytes - array of bytes from which Argument will be restored
offset - offset in array

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

write

protected void write(long handle,
                     int offset)
              throws MemoryException
Description copied from class: Argument
Writes itself to the memory. Exact memory address specified by params.

Specified by:
write in class Argument
Parameters:
handle - identifies location in memory where Argument will be written
offset - memory address offset
Throws:
MemoryException - if memory manipulations or memory access failed

read

protected void read(long handle,
                    int offset)
             throws MemoryException
Description copied from class: Argument
Reads itself from the memory. Exact memory address specified by params.

Specified by:
read in class Argument
Parameters:
handle - identifies location in memory from which Argument will be read
offset - memory address offset
Throws:
MemoryException - if memory manipulations or memory access failed

isFixedLength

protected boolean isFixedLength()
Description copied from class: Argument
Identify if Argument is a fixed length variable.

Specified by:
isFixedLength in class Argument
Returns:
true if it is so, and false otherwise


Copyright © 2004-2005 Smardec. All Rights Reserved.