Package jnr.ffi
Class StructLayout.Float
- java.lang.Object
-
- jnr.ffi.StructLayout.Field
-
- jnr.ffi.StructLayout.NumberField
-
- jnr.ffi.StructLayout.Float
-
- Enclosing class:
- StructLayout
public class StructLayout.Float extends StructLayout.NumberField
-
-
Field Summary
-
Fields inherited from class jnr.ffi.StructLayout.NumberField
type
-
-
Constructor Summary
Constructors Constructor Description Float()
Float(StructLayout.Offset offset)
Creates a new float field at a specific offset
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue(Pointer ptr)
Returns anfloat
representation of thisNumber
.float
floatValue(Pointer ptr)
Returns anfloat
representation of thisNumber
.float
get(Pointer ptr)
int
intValue(Pointer ptr)
Returns aint
representation of thisNumber
.long
longValue(Pointer ptr)
Returns along
representation of thisNumber
.void
set(Pointer ptr, float value)
void
set(Pointer ptr, java.lang.Number value)
Sets the field to a new value.java.lang.String
toString(Pointer ptr)
Returns a string representation of thisNumber
.-
Methods inherited from class jnr.ffi.StructLayout.NumberField
byteValue, shortValue
-
Methods inherited from class jnr.ffi.StructLayout.Field
enclosing, offset
-
-
-
-
Constructor Detail
-
Float
public Float()
-
Float
public Float(StructLayout.Offset offset)
Creates a new float field at a specific offset- Parameters:
offset
- The offset within the memory area for this field.
-
-
Method Detail
-
get
public final float get(Pointer ptr)
-
set
public final void set(Pointer ptr, float value)
-
set
public void set(Pointer ptr, java.lang.Number value)
Description copied from class:StructLayout.NumberField
Sets the field to a new value.- Specified by:
set
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.value
- The new value.
-
intValue
public final int intValue(Pointer ptr)
Description copied from class:StructLayout.NumberField
Returns aint
representation of thisNumber
.- Specified by:
intValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a
int
value for thisNumber
.
-
doubleValue
public final double doubleValue(Pointer ptr)
Description copied from class:StructLayout.NumberField
Returns anfloat
representation of thisNumber
.- Overrides:
doubleValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- an
float
value for thisNumber
.
-
floatValue
public final float floatValue(Pointer ptr)
Description copied from class:StructLayout.NumberField
Returns anfloat
representation of thisNumber
.- Overrides:
floatValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- an
float
value for thisNumber
.
-
longValue
public final long longValue(Pointer ptr)
Description copied from class:StructLayout.NumberField
Returns along
representation of thisNumber
.- Overrides:
longValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a
long
value for thisNumber
.
-
toString
public final java.lang.String toString(Pointer ptr)
Description copied from class:StructLayout.NumberField
Returns a string representation of thisNumber
.- Overrides:
toString
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a string representation of this
Number
.
-
-