public abstract class PointerType extends Object implements NativeMapped
NativeMapped.fromNative(java.lang.Object, com.sun.jna.FromNativeContext)
method,
which should instantiate a new object (or look up an existing one)
of the appropriate type.Modifier | Constructor and Description |
---|---|
protected |
PointerType()
The default constructor wraps a NULL pointer.
|
protected |
PointerType(Pointer p)
This constructor is typically used by
fromNative(java.lang.Object, com.sun.jna.FromNativeContext) if generating
a new object instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Instances of
PointerType with identical pointers compare
equal by default. |
Object |
fromNative(Object nativeValue,
FromNativeContext context)
The default implementation simply creates a new instance of the class
and assigns its pointer field.
|
Pointer |
getPointer()
Returns the associated native
Pointer . |
int |
hashCode()
The hash code for a
PointerType is the same as that for
its pointer. |
Class<?> |
nativeType()
Indicate the native type used by this converter.
|
void |
setPointer(Pointer p) |
Object |
toNative()
Convert this object to its native type (a
Pointer ). |
String |
toString() |
protected PointerType()
protected PointerType(Pointer p)
fromNative(java.lang.Object, com.sun.jna.FromNativeContext)
if generating
a new object instance.public Class<?> nativeType()
NativeMapped
nativeType
in interface NativeMapped
public Object toNative()
Pointer
).toNative
in interface NativeMapped
public Pointer getPointer()
Pointer
.public void setPointer(Pointer p)
public Object fromNative(Object nativeValue, FromNativeContext context)
PointerType
instance for each unique
Pointer
value, or instantiating a different PointerType
subclass.fromNative
in interface NativeMapped
nativeValue
- Java representation of the native type to be converted.context
- Context in which the conversion is taking place.public int hashCode()
PointerType
is the same as that for
its pointer.public boolean equals(Object o)
PointerType
with identical pointers compare
equal by default.