jnr.ffi
Class StructLayout.Enum8<E extends Enum<E>>

java.lang.Object
  extended by jnr.ffi.StructLayout.Field
      extended by jnr.ffi.StructLayout.NumberField
          extended by jnr.ffi.StructLayout.EnumField<E>
              extended by jnr.ffi.StructLayout.Enum8<E>
Type Parameters:
E - the Enum to translate to/from.
Enclosing class:
StructLayout

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

An 8 bit enum field.


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

Constructor Detail

StructLayout.Enum8

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

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

set

public final void set(Pointer ptr,
                      E value)
Sets the native integer value using a java Enum value.

Parameters:
value - the java Enum value.

set

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

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

intValue

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

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


Copyright © 2012. All Rights Reserved.