- java.lang.Object
-
- jnr.ffi.Struct.Member
-
- jnr.ffi.Struct.NumberField
-
- jnr.ffi.Struct.EnumField<E>
-
- jnr.ffi.Struct.Enum8<E>
-
- Type Parameters:
E- theEnumto translate to/from.
- Enclosing class:
- Struct
public class Struct.Enum8<E extends Enum<E>> extends Struct.EnumField<E>
An 8 bit enum field.
-
-
Field Summary
-
Fields inherited from class jnr.ffi.Struct.EnumField
enumClass
-
Fields inherited from class jnr.ffi.Struct.NumberField
type
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Eget()Gets a java Enum value representing the native integer value.intintValue()Returns an integer representation of this enum field.voidset(E value)Sets the native integer value using a java Enum value.voidset(Number value)Sets the field to a new value.-
Methods inherited from class jnr.ffi.Struct.EnumField
toString
-
Methods inherited from class jnr.ffi.Struct.NumberField
byteValue, doubleValue, floatValue, getMemory, longValue, offset, shortValue, struct
-
-
-
-
Method Detail
-
get
public final E get()
Gets a java Enum value representing the native integer value.- Specified by:
getin classStruct.EnumField<E extends Enum<E>>- Returns:
- a java Enum value.
-
set
public final void set(E value)
Sets the native integer value using a java Enum value.- Parameters:
value- the javaEnumvalue.
-
set
public void set(Number value)
Description copied from class:Struct.NumberFieldSets the field to a new value.- Specified by:
setin classStruct.NumberField- Parameters:
value- The new value.
-
intValue
public final int intValue()
Returns an integer representation of this enum field.- Specified by:
intValuein classStruct.NumberField- Returns:
- an integer value for this enum field.
-
-