com.moesol.bindings.platform_sdk.windows_api
Class HANDLE

java.lang.Object
  extended by com.moesol.bindings.platform_sdk.windows_api.HANDLE
Direct Known Subclasses:
HBITMAP, HDC, HGDIOBJ, HKEY, HMENU, HWND

public class HANDLE
extends Object

An opaque HANDLE that represents a Win32 HANDLE. It is opaque from java side, only JNI can set the m_handle field, usually by calling the protected constructor. When assertions are turned on this class does leak detection.


Constructor Summary
protected HANDLE(long handle)
          Create a tracked handle that will report as leaked if it is finalized befre being detached.
protected HANDLE(long handle, boolean temporary)
          Create a temporary handle that is not reported as leaked if finalize is called and m_handle is non-zero.
 
Method Summary
 long _getHandle()
          Returns the native handle.
static long _safeGetHandle(HANDLE handle)
          Returns the native handle of handle.
 void detach()
           
 boolean equals(Object o)
           
static long getLeakCount()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HANDLE

protected HANDLE(long handle,
                 boolean temporary)
Create a temporary handle that is not reported as leaked if finalize is called and m_handle is non-zero.

Parameters:
handle -
temporary - - if false same as calling HANDLE(long)

HANDLE

protected HANDLE(long handle)
Create a tracked handle that will report as leaked if it is finalized befre being detached.

Parameters:
handle -
Method Detail

_getHandle

public long _getHandle()
Returns the native handle.


_safeGetHandle

public static long _safeGetHandle(HANDLE handle)
Returns the native handle of handle. Safe to call for null handles, returns 0 in this case.

Parameters:
handle -
Returns:
native handle or 0 if handle is null.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

detach

public void detach()

getLeakCount

public static long getLeakCount()


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.