com.kenai.jaffl.struct
Class Struct.Enum8<E extends Enum<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>
              extended by com.kenai.jaffl.struct.Struct.Enum8<E>
Type Parameters:
E - the Enum to translate to/from.
All Implemented Interfaces:
Struct.Member, Serializable
Enclosing class:
Struct

public class Struct.Enum8<E extends Enum<E>>
extends Struct.EnumField<E>

An 8 bit enum field.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.kenai.jaffl.struct.Struct.EnumField
enumClass
 
Constructor Summary
Struct.Enum8(Class<E> enumClass)
          Creates a new 8 bit enum field.
 
Method Summary
 E get()
          Gets a java Enum value representing the native integer value.
 int intValue()
          Returns an integer representation of this enum field.
 void set(E value)
          Sets the native integer value using a java Enum value.
 void set(Number value)
          Sets the field to a new value.
 
Methods inherited from class com.kenai.jaffl.struct.Struct.EnumField
toString
 
Methods inherited from class com.kenai.jaffl.struct.Struct.NumberField
doubleValue, floatValue, getMemoryIO, longValue, offset, struct
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Struct.Enum8

public Struct.Enum8(Class<E> enumClass)
Creates a new 8 bit enum field.

Parameters:
enumClass - the class of the Enum.
Method Detail

get

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

Specified by:
get in class Struct.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 java Enum value.

set

public void set(Number value)
Description copied from class: Struct.NumberField
Sets the field to a new value.

Specified by:
set in class Struct.NumberField
Parameters:
value - The new value.

intValue

public final int intValue()
Returns an integer representation of this enum field.

Specified by:
intValue in class Number
Returns:
an integer value for this enum field.


Copyright © 2011. All Rights Reserved.