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.ptr.ByReference
Imports
java.lang.reflect.InvocationTargetException

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
Java representation of the native type to be converted.
nativeValue
,
FromNativeContext
Context in which the conversion is taking place.
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

Returns:

Native pointer representation for this object.
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<?>
nativeType()

Implements com.sun.jna.NativeMapped.nativeType.

Indicate the native type used by this converter.
public void
public Object
toNative()

Implements com.sun.jna.NativeMapped.toNative.

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

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

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.

Annotations
@Override
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.

Parameters
nativeValue:Object

Doc from com.sun.jna.NativeMapped.fromNative.

Java representation of the native type to be converted.

context:FromNativeContext

Doc from com.sun.jna.NativeMapped.fromNative.

Context in which the conversion is taking place.

Returns:Object

Doc from com.sun.jna.NativeMapped.fromNative.

Converted object.

Annotations
@Override
getPointerback to summary
public Pointer getPointer()

Returns the associated native Pointer.

Returns:Pointer

Native pointer representation for this object.

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.

Annotations
@Override
nativeTypeback to summary
public Class<?> nativeType()

Implements com.sun.jna.NativeMapped.nativeType.

Doc from com.sun.jna.NativeMapped.nativeType.

Indicate the native type used by this converter.

Returns:Class<?>

Java class representation of the native type.

Annotations
@Override
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).

Returns:Object

Doc from com.sun.jna.NativeMapped.toNative.

Java representation of the original Java object converted to a native type.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override