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 newAddressfield.Pointer(StructLayout.Offset offset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pointerget(Pointer ptr)Gets thePointervalue from the native memory.intintValue(Pointer ptr)Returns an integer representation of thisPointer.longlongValue(Pointer ptr)Returns anlongrepresentation of thisPointer.voidset(Pointer ptr, Number value)Sets the field to a new value.voidset(Pointer ptr, Pointer value)Sets aPointervalue in the native memory.intsize()Gets the size of a Pointer in bitsStringtoString(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 newAddressfield.
-
Pointer
public Pointer(StructLayout.Offset offset)
-
-
Method Detail
-
get
public final Pointer get(Pointer ptr)
Gets thePointervalue 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 aPointervalue in the native memory.- Parameters:
ptr- The pointer to the write location.value- The value to set.
-
set
public void set(Pointer ptr, Number value)
Description copied from class:StructLayout.NumberFieldSets the field to a new value.- Specified by:
setin 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:
intValuein classStructLayout.NumberField- Parameters:
ptr- The pointer to the field.- Returns:
- an integer value for this
Pointer.
-
longValue
public final long longValue(Pointer ptr)
Returns anlongrepresentation of thisPointer.- Overrides:
longValuein classStructLayout.NumberField- Parameters:
ptr- The pointer to the field.- Returns:
- an
longvalue for thisPointer.
-
toString
public final String toString(Pointer ptr)
Returns a string representation of thisPointer.- Overrides:
toStringin classStructLayout.NumberField- Parameters:
ptr- The pointer to the field.- Returns:
- a string representation of this
Pointer.
-
-