Package jnr.ffi

Class StructLayout.Enum8<E extends Enum<E>>

Type Parameters:
E - the Enum to translate to/from.
Enclosing class:
StructLayout

public class StructLayout.Enum8<E extends Enum<E>> extends StructLayout.EnumField<E>
An 8 bit enum field.
  • Constructor Details

    • Enum8

      public Enum8(Class<E> enumClass)
      Creates a new 8 bit enum field.
      Parameters:
      enumClass - the class of the Enum.
    • Enum8

      public Enum8(Class<E> enumClass, StructLayout.Offset offset)
      Creates a new 8 bit enum field.
      Parameters:
      enumClass - the class of the Enum.
      offset - the offset of the enum field.
  • Method Details

    • set

      public final void set(Pointer ptr, E value)
      Sets the native integer value using a java Enum value.
      Parameters:
      ptr - The pointer to the field.
      value - the java Enum value.
    • set

      public void set(Pointer ptr, Number value)
      Description copied from class: StructLayout.NumberField
      Sets the field to a new value.
      Specified by:
      set in class StructLayout.NumberField
      Parameters:
      ptr - The pointer to the field.
      value - The new value.
    • intValue

      public final int intValue(Pointer ptr)
      Returns an integer representation of this enum field.
      Specified by:
      intValue in class StructLayout.NumberField
      Parameters:
      ptr - The pointer to the field.
      Returns:
      an integer value for this enum field.