com.jniwrapper
Class Int8

java.lang.Object
  extended by com.jniwrapper.Parameter
      extended by com.jniwrapper.Int8
All Implemented Interfaces:
IntegerParameter

public class Int8
extends Parameter

Represents an 8-bit integer (byte) value and type.


Field Summary
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
Int8()
          Constructs a new 8-bit integer parameter.
Int8(byte value)
          Constructs a new 8-bit integer parameter.
Int8(IntegerParameter value)
          Constructs a new instance with the same value as in the passed IntegerParameter.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Compares two instances as IntegerParameter by their value.
 java.lang.String getDebugInfo()
          Return debug info for JNIWrapper parameter.
 int getLength()
          Returns the length of the parameter in memory.
 long getValue()
          Returns an integer value converted to long
 int hashCode()
           
 void pop(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Default implementation that does nothing because most primitive types do nothing on pop.
 void push(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Writes a parameter to a function stacks.
 void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Reads this parameter from a specified data source.
 void setValue(long val)
          Sets an integer value.
 java.lang.Long toLong()
           
 java.lang.String toString()
           
 void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Writes this parameter to a specified data source.
 
Methods inherited from class com.jniwrapper.Parameter
acceptIOPerformer, asReturnValue, dataBufferAssigned, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Int8

public Int8()
Constructs a new 8-bit integer parameter.


Int8

public Int8(byte value)
Constructs a new 8-bit integer parameter.

Parameters:
value - initial value.

Int8

public Int8(IntegerParameter value)
Constructs a new instance with the same value as in the passed IntegerParameter. Values are converted to the byte type, and values beyond the byte range may lose significant bits.

Method Detail

getLength

public int getLength()
Description copied from class: Parameter
Returns the length of the parameter in memory. This method is similar to C sizeof() operator.

Specified by:
getLength in class Parameter
Returns:
1

clone

public java.lang.Object clone()
Specified by:
clone in class Parameter

getValue

public long getValue()
Description copied from interface: IntegerParameter
Returns an integer value converted to long


setValue

public void setValue(long val)
Description copied from interface: IntegerParameter
Sets an integer value.


write

public void write(DataBuffer stackBuffer,
                  int offset,
                  boolean invokedByCallback)
           throws MemoryAccessViolationException
Description copied from class: Parameter
Writes this parameter to a specified data source.

Specified by:
write in class Parameter
Throws:
MemoryAccessViolationException

read

public void read(DataBuffer stackBuffer,
                 int offset,
                 boolean invokedByCallback)
          throws MemoryAccessViolationException
Description copied from class: Parameter
Reads this parameter from a specified data source.

Specified by:
read in class Parameter
Throws:
MemoryAccessViolationException

push

public void push(DataBuffer stackBuffer,
                 int offset,
                 boolean invokedByCallback)
          throws MemoryAccessViolationException
Description copied from class: Parameter
Writes a parameter to a function stacks.

Overrides:
push in class Parameter
Throws:
MemoryAccessViolationException

pop

public void pop(DataBuffer stackBuffer,
                int offset,
                boolean invokedByCallback)
         throws MemoryAccessViolationException
Description copied from class: Parameter
Default implementation that does nothing because most primitive types do nothing on pop. Reads a parameter from a function stack.

Overrides:
pop in class Parameter
Throws:
MemoryAccessViolationException

equals

public boolean equals(java.lang.Object obj)
Compares two instances as IntegerParameter by their value.

Overrides:
equals in class Parameter
Parameters:
obj - a value to compare this object to.
Returns:
true if values are equal.

hashCode

public int hashCode()
Overrides:
hashCode in class Parameter

toLong

public java.lang.Long toLong()

getDebugInfo

public java.lang.String getDebugInfo()
Description copied from class: Parameter
Return debug info for JNIWrapper parameter.

Specified by:
getDebugInfo in class Parameter
Returns:
debug info

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object