jnr.ffi
Class StructLayout.EnumField<E extends Enum<E>>
java.lang.Object
jnr.ffi.StructLayout.Field
jnr.ffi.StructLayout.NumberField
jnr.ffi.StructLayout.EnumField<E>
- Type Parameters:
E
- the type of Enum
- Direct Known Subclasses:
- StructLayout.Enum16, StructLayout.Enum32, StructLayout.Enum64, StructLayout.Enum8, StructLayout.EnumLong
- Enclosing class:
- StructLayout
protected abstract class StructLayout.EnumField<E extends Enum<E>>
- extends StructLayout.NumberField
Base for all the Enum fields.
Method Summary |
E |
get(Pointer ptr)
Gets a java Enum value representing the native integer value. |
String |
toString(Pointer ptr)
Returns a string representation of this field. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
enumClass
protected final Class<E extends Enum<E>> enumClass
enumMapper
protected final EnumMapper enumMapper
StructLayout.EnumField
public StructLayout.EnumField(NativeType type,
Class<E> enumClass)
- Constructs a new Enum field.
- Parameters:
type
- the native type of the enum.enumClass
- the Enum class.
get
public E get(Pointer ptr)
- Gets a java Enum value representing the native integer value.
- Returns:
- a java Enum value.
toString
public final String toString(Pointer ptr)
- Returns a string representation of this field.
- Overrides:
toString
in class StructLayout.NumberField
- Returns:
- a string representation of this field.
Copyright © 2012. All Rights Reserved.