java.lang.Object
jnr.ffi.StructLayout.Field
jnr.ffi.StructLayout.NumberField
jnr.ffi.StructLayout.EnumField<E>
- Type Parameters:
E
- the type ofEnum
- Direct Known Subclasses:
StructLayout.Enum16
,StructLayout.Enum32
,StructLayout.Enum64
,StructLayout.Enum8
,StructLayout.EnumLong
- Enclosing class:
StructLayout
Base for all the Enum fields.
-
Field Summary
FieldsFields inherited from class jnr.ffi.StructLayout.NumberField
type
-
Constructor Summary
ConstructorsConstructorDescriptionEnumField
(NativeType type, Class<E> enumClass) Constructs a new Enum field.EnumField
(NativeType type, Class<E> enumClass, StructLayout.Offset offset) Constructs a new Enum field. -
Method Summary
Methods inherited from class jnr.ffi.StructLayout.NumberField
byteValue, doubleValue, floatValue, intValue, longValue, set, shortValue
Methods inherited from class jnr.ffi.StructLayout.Field
enclosing, offset
-
Field Details
-
enumClass
-
enumMapper
-
-
Constructor Details
-
EnumField
Constructs a new Enum field.- Parameters:
type
- the native type of the enum.enumClass
- the Enum class.
-
EnumField
Constructs a new Enum field.- Parameters:
type
- the native type of the enum.enumClass
- the Enum class.offset
- the offset.
-
-
Method Details
-
get
Gets a java Enum value representing the native integer value.- Parameters:
ptr
- The pointer to the field.- Returns:
- a java Enum value.
-
toString
Returns a string representation of this field.- Overrides:
toString
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a string representation of this field.
-