Package jnr.ffi
Class StructLayout.NumberField
java.lang.Object
jnr.ffi.StructLayout.Field
jnr.ffi.StructLayout.NumberField
- Direct Known Subclasses:
StructLayout.Double
,StructLayout.EnumField
,StructLayout.Float
,StructLayout.IntegerAlias
,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
Base class for all Number structure fields.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
NumberField
(NativeType nativeType) protected
NumberField
(NativeType nativeType, StructLayout.Offset offset) protected
NumberField
(Type type) protected
NumberField
(Type type, StructLayout.Offset offset) -
Method Summary
Modifier and TypeMethodDescriptionbyte
Returns abyte
representation of thisNumber
.double
doubleValue
(Pointer ptr) Returns anfloat
representation of thisNumber
.float
floatValue
(Pointer ptr) Returns anfloat
representation of thisNumber
.abstract int
Returns aint
representation of thisNumber
.long
Returns along
representation of thisNumber
.abstract void
Sets the field to a new value.short
shortValue
(Pointer ptr) Returns ashort
representation of thisNumber
.Returns a string representation of thisNumber
.Methods inherited from class jnr.ffi.StructLayout.Field
enclosing, offset
-
Field Details
-
type
-
-
Constructor Details
-
NumberField
-
NumberField
-
NumberField
-
NumberField
-
-
Method Details
-
set
Sets the field to a new value.- Parameters:
ptr
- The pointer to the field.value
- The new value.
-
doubleValue
Returns anfloat
representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- an
float
value for thisNumber
.
-
floatValue
Returns anfloat
representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- an
float
value for thisNumber
.
-
byteValue
Returns abyte
representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- a
byte
value for thisNumber
.
-
shortValue
Returns ashort
representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- a
short
value for thisNumber
.
-
intValue
Returns aint
representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- a
int
value for thisNumber
.
-
longValue
Returns along
representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- a
long
value for thisNumber
.
-
toString
Returns a string representation of thisNumber
.- Parameters:
ptr
- The pointer to the field.- Returns:
- a string representation of this
Number
.
-