Package jnr.ffi
Class StructLayout.Unsigned8
- java.lang.Object
-
- jnr.ffi.StructLayout.Field
-
- jnr.ffi.StructLayout.NumberField
-
- jnr.ffi.StructLayout.Unsigned8
-
- Enclosing class:
- StructLayout
public class StructLayout.Unsigned8 extends StructLayout.NumberField
An 8 bit unsigned integer
-
-
Field Summary
-
Fields inherited from class jnr.ffi.StructLayout.NumberField
type
-
-
Constructor Summary
Constructors Constructor Description Unsigned8()
Creates a new 8 bit unsigned integer field.Unsigned8(StructLayout.Offset offset)
Creates a new 8 bit unsigned integer field at a specific offset
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
get(Pointer ptr)
Gets the value for this field.int
intValue(Pointer ptr)
Returns a java int representation of this field.void
set(Pointer ptr, short value)
Sets the value for this field.void
set(Pointer ptr, java.lang.Number value)
Sets the field to a new value.short
shortValue(Pointer ptr)
Returns a java short representation of this field.-
Methods inherited from class jnr.ffi.StructLayout.NumberField
byteValue, doubleValue, floatValue, longValue, toString
-
Methods inherited from class jnr.ffi.StructLayout.Field
enclosing, offset
-
-
-
-
Constructor Detail
-
Unsigned8
public Unsigned8()
Creates a new 8 bit unsigned integer field.
-
Unsigned8
public Unsigned8(StructLayout.Offset offset)
Creates a new 8 bit unsigned integer field at a specific offset- Parameters:
offset
- The offset within the memory area for this field.
-
-
Method Detail
-
get
public final short get(Pointer ptr)
Gets the value for this field.- Parameters:
ptr
- The pointer to the field.- Returns:
- a byte.
-
set
public final void set(Pointer ptr, short value)
Sets the value for this field.- Parameters:
ptr
- The pointer to the field.value
- the 8 bit value to set.
-
set
public void set(Pointer ptr, java.lang.Number value)
Description copied from class:StructLayout.NumberField
Sets the field to a new value.- Specified by:
set
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.value
- The new value.
-
shortValue
public final short shortValue(Pointer ptr)
Returns a java short representation of this field.- Overrides:
shortValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a java short value for this field.
-
intValue
public final int intValue(Pointer ptr)
Returns a java int representation of this field.- Specified by:
intValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a java int value for this field.
-
-