Package com.sun.jna
Class PointerType
- java.lang.Object
- 
- com.sun.jna.PointerType
 
- 
- All Implemented Interfaces:
- NativeMapped
 - Direct Known Subclasses:
- ByReference,- COMInvoker,- CoreFoundation.CFTypeRef,- Ddeml.HCONV,- Ddeml.HCONVLIST,- Ddeml.HSZ,- Guid.REFIID,- IOKit.IOObject,- Kstat2.Kstat2Handle,- Kstat2.Kstat2Map,- Kstat2.Kstat2MatcherList,- Udev.UdevContext,- Udev.UdevDevice,- Udev.UdevEnumerate,- Udev.UdevListEntry,- WinDef.LPVOID,- WinDef.PVOID,- WinNT.HANDLE,- WTypes.BSTR,- WTypes.LPOLESTR,- WTypes.LPSTR,- WTypes.LPWSTR,- X11.Display,- X11.GC,- X11.Screen,- X11.Visual,- X11.XImage
 
 public abstract class PointerType extends java.lang.Object implements NativeMapped Type representing a type-safe native pointer. Derived classes may override theNativeMapped.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.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedPointerType()The default constructor wraps a NULL pointer.protectedPointerType(Pointer p)This constructor is typically used byfromNative(java.lang.Object, com.sun.jna.FromNativeContext)if generating a new object instance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Instances ofPointerTypewith identical pointers compare equal by default.java.lang.ObjectfromNative(java.lang.Object nativeValue, FromNativeContext context)The default implementation simply creates a new instance of the class and assigns its pointer field.PointergetPointer()Returns the associated nativePointer.inthashCode()The hash code for aPointerTypeis the same as that for its pointer.java.lang.Class<?>nativeType()Indicate the native type used by this converter.voidsetPointer(Pointer p)java.lang.ObjecttoNative()Convert this object to its native type (aPointer).java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
PointerTypeprotected PointerType() The default constructor wraps a NULL pointer.
 - 
PointerTypeprotected PointerType(Pointer p) This constructor is typically used byfromNative(java.lang.Object, com.sun.jna.FromNativeContext)if generating a new object instance.
 
- 
 - 
Method Detail- 
nativeTypepublic java.lang.Class<?> nativeType() Description copied from interface:NativeMappedIndicate the native type used by this converter.- Specified by:
- nativeTypein interface- NativeMapped
- Returns:
- Java class representation of the native type.
 
 - 
toNativepublic java.lang.Object toNative() Convert this object to its native type (aPointer).- Specified by:
- toNativein interface- NativeMapped
- Returns:
- Java representation of the original Java object converted to a native type.
 
 - 
getPointerpublic Pointer getPointer() Returns the associated nativePointer.- Returns:
- Native pointer representation for this object.
 
 - 
setPointerpublic void setPointer(Pointer p) 
 - 
fromNativepublic java.lang.Object fromNative(java.lang.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 singlePointerTypeinstance for each uniquePointervalue, or instantiating a differentPointerTypesubclass.- Specified by:
- fromNativein interface- NativeMapped
- Parameters:
- nativeValue- Java representation of the native type to be converted.
- context- Context in which the conversion is taking place.
- Returns:
- Converted object.
 
 - 
hashCodepublic int hashCode() The hash code for aPointerTypeis the same as that for its pointer.- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) Instances ofPointerTypewith identical pointers compare equal by default.- Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-