com.kenai.jaffl.struct
Class Struct.NumberField

java.lang.Object
  extended by java.lang.Number
      extended by com.kenai.jaffl.struct.Struct.NumberField
All Implemented Interfaces:
Struct.Member, java.io.Serializable
Direct Known Subclasses:
Struct.Address, Struct.Double, Struct.EnumField, Struct.Float, Struct.Pointer, Struct.Signed16, Struct.Signed32, Struct.Signed64, Struct.Signed8, Struct.SignedLong, Struct.Unsigned16, Struct.Unsigned32, Struct.Unsigned64, Struct.Unsigned8, Struct.UnsignedLong
Enclosing class:
Struct

protected abstract class Struct.NumberField
extends java.lang.Number
implements Struct.Member

Base class for all Number structure fields.

See Also:
Serialized Form

Constructor Summary
protected Struct.NumberField(int size)
           
protected Struct.NumberField(int size, int align)
           
protected Struct.NumberField(int size, int align, Struct.Offset offset)
           
protected Struct.NumberField(int size, Struct.Offset offset)
           
 
Method Summary
 double doubleValue()
          Returns an float representation of this Number.
 float floatValue()
          Returns an float representation of this Number.
 MemoryIO getMemoryIO()
          Gets the MemoryIO used to read/write this Member.
 long longValue()
          Returns an long representation of this Number.
 long offset()
          Gets the offset within the structure for this field.
abstract  void set(java.lang.Number value)
          Sets the field to a new value.
 Struct struct()
          Gets the Struct this Member is in.
 java.lang.String toString()
          Returns a string representation of this Address.
 
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
 

Constructor Detail

Struct.NumberField

protected Struct.NumberField(int size)

Struct.NumberField

protected Struct.NumberField(int size,
                             Struct.Offset offset)

Struct.NumberField

protected Struct.NumberField(int size,
                             int align,
                             Struct.Offset offset)

Struct.NumberField

protected Struct.NumberField(int size,
                             int align)
Method Detail

getMemoryIO

public final MemoryIO getMemoryIO()
Gets the MemoryIO used to read/write this Member.

Specified by:
getMemoryIO in interface Struct.Member
Returns:
a MemoryIO.

struct

public final Struct struct()
Gets the Struct this Member is in.

Specified by:
struct in interface Struct.Member
Returns:
a Struct.

offset

public final long offset()
Gets the offset within the structure for this field.

Specified by:
offset in interface Struct.Member

set

public abstract void set(java.lang.Number value)
Sets the field to a new value.

Parameters:
value - The new value.

doubleValue

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

Specified by:
doubleValue in class java.lang.Number
Returns:
an float value for this Number.

floatValue

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

Specified by:
floatValue in class java.lang.Number
Returns:
an float value for this Number.

longValue

public long longValue()
Returns an long representation of this Number.

Specified by:
longValue in class java.lang.Number
Returns:
an long value for this Number.

toString

public java.lang.String toString()
Returns a string representation of this Address.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this Address.