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
Base class for all Number structure fields.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNumberField(NativeType type) protectedNumberField(NativeType type, Struct.Offset offset) protectedNumberField(TypeAlias type) protectedNumberField(TypeAlias type, Struct.Offset offset) -
Method Summary
Modifier and TypeMethodDescriptionbyteReturns abyterepresentation of thisNumber.doubleReturns anfloatrepresentation of thisNumber.floatReturns anfloatrepresentation of thisNumber.final PointerGets the memory object used to store thisMemberabstract intintValue()Returns aintrepresentation of thisNumber.longReturns alongrepresentation of thisNumber.final longoffset()Gets the offset within the structure for this field.abstract voidSets the field to a new value.shortReturns ashortrepresentation of thisNumber.final Structstruct()Gets theStructthisMemberis in.toString()Returns a string representation of thisNumber.
-
Field Details
-
offset
private final int offsetOffset from the start of theStructmemory this field is located at. -
type
-
-
Constructor Details
-
NumberField
-
NumberField
-
NumberField
-
NumberField
-
-
Method Details
-
getMemory
Description copied from class:Struct.MemberGets the memory object used to store thisMember- Specified by:
getMemoryin classStruct.Member- Returns:
- a
Pointer
-
struct
Gets theStructthisMemberis in.- Specified by:
structin classStruct.Member- Returns:
- a
Struct.
-
offset
public final long offset()Gets the offset within the structure for this field.- Specified by:
offsetin classStruct.Member- Returns:
- the offset within the structure for this field.
-
set
Sets the field to a new value.- Parameters:
value- The new value.
-
doubleValue
public double doubleValue()Returns anfloatrepresentation of thisNumber.- Returns:
- an
floatvalue for thisNumber.
-
floatValue
public float floatValue()Returns anfloatrepresentation of thisNumber.- Returns:
- an
floatvalue for thisNumber.
-
byteValue
public byte byteValue()Returns abyterepresentation of thisNumber.- Returns:
- a
bytevalue for thisNumber.
-
shortValue
public short shortValue()Returns ashortrepresentation of thisNumber.- Returns:
- a
shortvalue for thisNumber.
-
intValue
public abstract int intValue()Returns aintrepresentation of thisNumber.- Returns:
- a
intvalue for thisNumber.
-
longValue
public long longValue()Returns alongrepresentation of thisNumber.- Returns:
- a
longvalue for thisNumber.
-
toString
-