jnr.ffi
Class StructLayout.NumberField

java.lang.Object
  extended by jnr.ffi.StructLayout.AbstractField
      extended by jnr.ffi.StructLayout.NumberField
All Implemented Interfaces:
StructLayout.Field
Direct Known Subclasses:
StructLayout.Double, StructLayout.Float, StructLayout.Pointer, StructLayout.Signed16, StructLayout.Signed32, StructLayout.Signed64, StructLayout.Signed8, StructLayout.SignedLong, StructLayout.Unsigned16, StructLayout.Unsigned32, StructLayout.Unsigned64, StructLayout.Unsigned8, StructLayout.UnsignedLong
Enclosing class:
StructLayout

protected abstract class StructLayout.NumberField
extends StructLayout.AbstractField

Base class for all Number structure fields.


Constructor Summary
protected StructLayout.NumberField(NativeType type)
           
protected StructLayout.NumberField(NativeType type, Struct.Offset offset)
           
 
Method Summary
 byte byteValue(Pointer ptr)
          Returns a byte representation of this Number.
 double doubleValue(Pointer ptr)
          Returns an float representation of this Number.
 float floatValue(Pointer ptr)
          Returns an float representation of this Number.
abstract  int intValue(Pointer ptr)
          Returns a int representation of this Number.
 long longValue(Pointer ptr)
          Returns a long representation of this Number.
abstract  void set(Pointer ptr, Number value)
          Sets the field to a new value.
 short shortValue(Pointer ptr)
          Returns a short representation of this Number.
 String toString(Pointer ptr)
          Returns a string representation of this Number.
 
Methods inherited from class jnr.ffi.StructLayout.AbstractField
enclosing, offset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructLayout.NumberField

protected StructLayout.NumberField(NativeType type)

StructLayout.NumberField

protected StructLayout.NumberField(NativeType type,
                                   Struct.Offset offset)
Method Detail

set

public abstract void set(Pointer ptr,
                         Number value)
Sets the field to a new value.

Parameters:
value - The new value.

doubleValue

public double doubleValue(Pointer ptr)
Returns an float representation of this Number.

Returns:
an float value for this Number.

floatValue

public float floatValue(Pointer ptr)
Returns an float representation of this Number.

Returns:
an float value for this Number.

byteValue

public byte byteValue(Pointer ptr)
Returns a byte representation of this Number.

Returns:
a byte value for this Number.

shortValue

public short shortValue(Pointer ptr)
Returns a short representation of this Number.

Returns:
a short value for this Number.

intValue

public abstract int intValue(Pointer ptr)
Returns a int representation of this Number.

Returns:
a int value for this Number.

longValue

public long longValue(Pointer ptr)
Returns a long representation of this Number.

Returns:
a long value for this Number.

toString

public String toString(Pointer ptr)
Returns a string representation of this Number.

Returns:
a string representation of this Number.


Copyright © 2012. All Rights Reserved.