Top Description Fields Constructors Methods
com.sun.jna

public abstract Class PointerType

extends Object
implements NativeMapped
Class Inheritance
All Implemented Interfaces
com.sun.jna.NativeMapped
Known Direct Subclasses
com.sun.jna.examples.unix.X11.Display, com.sun.jna.examples.unix.X11.Visual, com.sun.jna.examples.unix.X11.Screen, com.sun.jna.examples.unix.X11.GC, com.sun.jna.examples.win32.W32API.HANDLE, com.sun.jna.ptr.ByReference

Type representing a type-safe native pointer. Derived classes may override the NativeMapped#fromNative method, which should instantiate a new object (or look up an existing one) of the appropriate type.

Field Summary

Modifier and TypeField and Description
private Pointer

Constructor Summary

AccessConstructor and Description
protected
PointerType()

The default constructor wraps a NULL pointer.

protected
PointerType(Pointer p)

This constructor is typically used by fromNative if generating a new object instance.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Instances of PointerType with identical pointers compare equal by default.
public Object
fromNative(Object nativeValue, FromNativeContext context)

Implements com.sun.jna.NativeMapped.fromNative.

The default implementation simply creates a new instance of the class and assigns its pointer field.
public Pointer
getPointer()

Returns the associated native Pointer.

public int
hashCode()

Overrides java.lang.Object.hashCode.

The hash code for a PointerType is the same as that for its pointer.
public Class<T>
nativeType()

Implements com.sun.jna.NativeMapped.nativeType.

All PointerType classes represent a native Pointer.
public void
public Object
toNative()

Implements com.sun.jna.NativeMapped.toNative.

Convert this object to its native type (a Pointer).
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

pointerback to summary
private Pointer pointer

Constructor Detail

PointerTypeback to summary
protected PointerType()

The default constructor wraps a NULL pointer.

PointerTypeback to summary
protected PointerType(Pointer p)

This constructor is typically used by fromNative if generating a new object instance.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Instances of PointerType with identical pointers compare equal by default.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

fromNativeback to summary
public Object fromNative(Object nativeValue, FromNativeContext context)

Implements com.sun.jna.NativeMapped.fromNative.

The default implementation simply creates a new instance of the class and assigns its pointer field. Override if you need different behavior, such as ensuring a single PointerType instance for each unique Pointer value, or instantiating a different PointerType subclass.

getPointerback to summary
public Pointer getPointer()

Returns the associated native Pointer.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

The hash code for a PointerType is the same as that for its pointer.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

nativeTypeback to summary
public Class<T> nativeType()

Implements com.sun.jna.NativeMapped.nativeType.

All PointerType classes represent a native Pointer.

setPointerback to summary
public void setPointer(Pointer p)
toNativeback to summary
public Object toNative()

Implements com.sun.jna.NativeMapped.toNative.

Convert this object to its native type (a Pointer).