jnr.ffi
Class Struct.EnumField<E>

java.lang.Object
  extended by jnr.ffi.Struct.Member
      extended by jnr.ffi.Struct.NumberField
          extended by jnr.ffi.Struct.EnumField<E>
Type Parameters:
E - the type of Enum
Direct Known Subclasses:
Struct.Enum16, Struct.Enum32, Struct.Enum64, Struct.Enum8, Struct.EnumLong
Enclosing class:
Struct

protected abstract class Struct.EnumField<E>
extends Struct.NumberField

Base for all the Enum fields.


Field Summary
protected  Class<E> enumClass
           
 
Fields inherited from class jnr.ffi.Struct.NumberField
type
 
Constructor Summary
Struct.EnumField(NativeType type, Class<E> enumClass)
          Constructs a new Enum field.
 
Method Summary
abstract  E get()
          Gets a java Enum value representing the native integer value.
 String toString()
          Returns a string representation of this field.
 
Methods inherited from class jnr.ffi.Struct.NumberField
byteValue, doubleValue, floatValue, getMemory, intValue, longValue, offset, set, shortValue, struct
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enumClass

protected final Class<E> enumClass
Constructor Detail

Struct.EnumField

public Struct.EnumField(NativeType type,
                        Class<E> enumClass)
Constructs a new Enum field.

Parameters:
type - the native type of the enum.
enumClass - the Enum class.
Method Detail

get

public abstract E get()
Gets a java Enum value representing the native integer value.

Returns:
a java Enum value.

toString

public final String toString()
Returns a string representation of this field.

Overrides:
toString in class Struct.NumberField
Returns:
a string representation of this field.


Copyright © 2012. All Rights Reserved.