Package jnr.ffi
Class Struct.NumberField
- java.lang.Object
-
- jnr.ffi.Struct.Member
-
- jnr.ffi.Struct.NumberField
-
- Direct Known Subclasses:
Struct.Address,Struct.Double,Struct.EnumField,Struct.Float,Struct.IntegerAlias,Struct.PointerField,Struct.Signed16,Struct.Signed32,Struct.Signed64,Struct.Signed8,Struct.SignedLong,Struct.Unsigned16,Struct.Unsigned32,Struct.Unsigned64,Struct.Unsigned8,Struct.UnsignedLong
- Enclosing class:
- Struct
public abstract class Struct.NumberField extends Struct.Member
Base class for all Number structure fields.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNumberField(NativeType type)protectedNumberField(NativeType type, Struct.Offset offset)protectedNumberField(TypeAlias type)protectedNumberField(TypeAlias type, Struct.Offset offset)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description bytebyteValue()Returns abyterepresentation of this Number.doubledoubleValue()Returns anfloatrepresentation of this Number.floatfloatValue()Returns anfloatrepresentation of this Number.PointergetMemory()abstract intintValue()Returns aintrepresentation of this Number.longlongValue()Returns alongrepresentation of this Number.longoffset()Gets the offset within the structure for this field.abstract voidset(Number value)Sets the field to a new value.shortshortValue()Returns ashortrepresentation of this Number.Structstruct()Gets the Struct this Member is in.StringtoString()Returns a string representation of thisNumber.
-
-
-
Field Detail
-
type
protected final Type type
-
-
Constructor Detail
-
NumberField
protected NumberField(NativeType type)
-
NumberField
protected NumberField(NativeType type, Struct.Offset offset)
-
NumberField
protected NumberField(TypeAlias type)
-
NumberField
protected NumberField(TypeAlias type, Struct.Offset offset)
-
-
Method Detail
-
getMemory
public final Pointer getMemory()
-
struct
public final Struct struct()
Gets the Struct this Member is in.- Returns:
- a Struct.
-
offset
public final long offset()
Gets the offset within the structure for this field.
-
set
public abstract void set(Number value)
Sets the field to a new value.- Parameters:
value- The new value.
-
doubleValue
public double doubleValue()
Returns anfloatrepresentation of this Number.- Returns:
- an
floatvalue for this Number.
-
floatValue
public float floatValue()
Returns anfloatrepresentation of this Number.- Returns:
- an
floatvalue for this Number.
-
byteValue
public byte byteValue()
Returns abyterepresentation of this Number.- Returns:
- a
bytevalue for this Number.
-
shortValue
public short shortValue()
Returns ashortrepresentation of this Number.- Returns:
- a
shortvalue for this Number.
-
intValue
public abstract int intValue()
Returns aintrepresentation of this Number.- Returns:
- a
intvalue for this Number.
-
longValue
public long longValue()
Returns alongrepresentation of this Number.- Returns:
- a
longvalue for this Number.
-
-