com.sun.jna

Class PointerType

public abstract class PointerType extends Object implements NativeMapped

Type representing a type-safe native pointer. Derived classes may override the NativeMapped method, which should instantiate a new object (or look up an existing one) of the appropriate type.
Constructor Summary
protected PointerType()
The default constructor wraps a NULL pointer.
protected PointerType(Pointer p)
This constructor is typically used by PointerType if generating a new object instance.
Method Summary
booleanequals(Object o)
Instances of PointerType with identical pointers compare equal by default.
ObjectfromNative(Object nativeValue, FromNativeContext context)
The default implementation simply creates a new instance of the class and assigns its pointer field.
PointergetPointer()
Returns the associated native Pointer.
inthashCode()
The hash code for a PointerType is the same as that for its pointer.
ClassnativeType()
All PointerType classes represent a native Pointer.
voidsetPointer(Pointer p)
ObjecttoNative()
Convert this object to its native type (a Pointer).

Constructor Detail

PointerType

protected PointerType()
The default constructor wraps a NULL pointer.

PointerType

protected PointerType(Pointer p)
This constructor is typically used by PointerType if generating a new object instance.

Method Detail

equals

public boolean equals(Object o)
Instances of PointerType with identical pointers compare equal by default.

fromNative

public Object fromNative(Object nativeValue, FromNativeContext context)
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.

getPointer

public Pointer getPointer()
Returns the associated native Pointer.

hashCode

public int hashCode()
The hash code for a PointerType is the same as that for its pointer.

nativeType

public Class nativeType()
All PointerType classes represent a native Pointer.

setPointer

public void setPointer(Pointer p)

toNative

public Object toNative()
Convert this object to its native type (a Pointer).
Copyright © 2007-2009 Timothy Wall. All Rights Reserved.