com.jniwrapper
Class UInt8

java.lang.Object
  |
  +--com.jniwrapper.Parameter
        |
        +--com.jniwrapper.AbstractInteger
              |
              +--com.jniwrapper.UInt8
All Implemented Interfaces:
IntegerParameter

public class UInt8
extends com.jniwrapper.AbstractInteger

Represents 8-bit unsigned integer value and type.


Constructor Summary
UInt8()
          Constructs a new 8-bit unsigned parameter.
UInt8(IntegerParameter value)
          Constructs new instance with the same value as in the passed IntegerParameter.
UInt8(short value)
          Constructs a new 8-bit unsigned parameter.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Compares two instances as IntegerParameter by their value.
 int getLength()
          Returns a length of the parameter in memory.
 long getValue()
          Returns integer value converted to long
 void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Reads this parameter from a specified data source.
 void setValue(long val)
          Sets 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, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UInt8

public UInt8()
Constructs a new 8-bit unsigned parameter.


UInt8

public UInt8(short value)
Constructs a new 8-bit unsigned parameter.

Parameters:
value - initial value.

UInt8

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

Method Detail

getLength

public int getLength()
Description copied from class: Parameter
Returns a length of the parameter in memory. This method is analogous 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 integer value converted to long


setValue

public void setValue(long val)
Description copied from interface: IntegerParameter
Sets 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
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
MemoryAccessViolationException

equals

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

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

toString

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

toLong

public java.lang.Long toLong()