Package jnr.ffi
Class StructLayout.Pointer
- java.lang.Object
-
- jnr.ffi.StructLayout.Field
-
- jnr.ffi.StructLayout.NumberField
-
- jnr.ffi.StructLayout.Pointer
-
- Enclosing class:
- StructLayout
public class StructLayout.Pointer extends StructLayout.NumberField
Represents a native memory address.
-
-
Field Summary
-
Fields inherited from class jnr.ffi.StructLayout.NumberField
type
-
-
Constructor Summary
Constructors Constructor Description Pointer()
Creates a newAddress
field.Pointer(StructLayout.Offset offset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pointer
get(Pointer ptr)
Gets thePointer
value from the native memory.int
intValue(Pointer ptr)
Returns an integer representation of thisPointer
.long
longValue(Pointer ptr)
Returns anlong
representation of thisPointer
.void
set(Pointer ptr, java.lang.Number value)
Sets the field to a new value.void
set(Pointer ptr, Pointer value)
Sets aPointer
value in the native memory.int
size()
Gets the size of a Pointer in bitsjava.lang.String
toString(Pointer ptr)
Returns a string representation of thisPointer
.-
Methods inherited from class jnr.ffi.StructLayout.NumberField
byteValue, doubleValue, floatValue, shortValue
-
Methods inherited from class jnr.ffi.StructLayout.Field
enclosing, offset
-
-
-
-
Constructor Detail
-
Pointer
public Pointer()
Creates a newAddress
field.
-
Pointer
public Pointer(StructLayout.Offset offset)
-
-
Method Detail
-
get
public final Pointer get(Pointer ptr)
Gets thePointer
value from the native memory.- Parameters:
ptr
- The pointer to the field.- Returns:
- a
Pointer
.
-
size
public final int size()
Gets the size of a Pointer in bits- Returns:
- the size of the Pointer
-
set
public final void set(Pointer ptr, Pointer value)
Sets aPointer
value in the native memory.- Parameters:
ptr
- The pointer to the write location.value
- The value to set.
-
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)
Returns an integer representation of thisPointer
.- Specified by:
intValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- an integer value for this
Pointer
.
-
longValue
public final long longValue(Pointer ptr)
Returns anlong
representation of thisPointer
.- Overrides:
longValue
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- an
long
value for thisPointer
.
-
toString
public final java.lang.String toString(Pointer ptr)
Returns a string representation of thisPointer
.- Overrides:
toString
in classStructLayout.NumberField
- Parameters:
ptr
- The pointer to the field.- Returns:
- a string representation of this
Pointer
.
-
-