com.kenai.jaffl.struct
Class Struct.EnumField<E>

java.lang.Object
  extended by java.lang.Number
      extended by com.kenai.jaffl.struct.Struct.NumberField
          extended by com.kenai.jaffl.struct.Struct.EnumField<E>
Type Parameters:
E - the type of Enum
All Implemented Interfaces:
Struct.Member, java.io.Serializable
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.

See Also:
Serialized Form

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

Field Detail

enumClass

protected final java.lang.Class<E> enumClass
Constructor Detail

Struct.EnumField

public Struct.EnumField(int size,
                        java.lang.Class<E> enumClass)
Constructs a new Enum field.

Parameters:
size - the size of the native integer.
enumClass - the Enum class.

Struct.EnumField

public Struct.EnumField(int size,
                        Struct.Offset offset,
                        java.lang.Class<E> enumClass)
Constructs a new Enum field.

Parameters:
size - the size of the native integer. * @param offset the offset from the start of the struct memory area.
enumClass - the Enum class.

Struct.EnumField

public Struct.EnumField(int size,
                        int align,
                        java.lang.Class<E> enumClass)
Constructs a new Enum field.

Parameters:
size - the size of the native integer.
align - the minimum alignment of the native integer
enumClass - the Enum class.

Struct.EnumField

public Struct.EnumField(int size,
                        int align,
                        Struct.Offset offset,
                        java.lang.Class<E> enumClass)
Constructs a new Enum field.

Parameters:
size - the size of the native integer.
align - the minimum alignment of the native integer
offset - the offset from the start of the struct memory area
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 java.lang.String toString()
Returns a string representation of this field.

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