org.gnu.glib
Class Boxed

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.Boxed
Direct Known Subclasses:
AttrList, Border, Color, Color, Cursor, Event, FontDescription, FontMetrics, GlyphString, IconInfo, IconSet, IconSource, Language, Rectangle, Requisition, SelectionData, TabArray, TextAttributes, TextIter, TreeIter, TreePath, TreeRowReference

public class Boxed
extends org.gnu.glib.Struct

A mechanism to wrap opaque structures registered by the type system.


Method Summary
 boolean equals(java.lang.Object other)
          Check if two objects refer to the same (native) object.
static Boxed getBoxedFromHandle(org.gnu.glib.Handle hndl)
          Gets a Boxed instance for the given Handle.
 int hashCode()
          Returns a hash code value for the object.
 
Methods inherited from class org.gnu.glib.Struct
getHandle, getNullHandle
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBoxedFromHandle

public static Boxed getBoxedFromHandle(org.gnu.glib.Handle hndl)
Gets a Boxed instance for the given Handle. If no Java object currently exists for the given Handle, this method will return null. You should then instantiate the required Java class using the class' handle-constructor. For example:
 // Get a Handle from somewhere (typically as a parameter to a method
 // used as a callback and invoked from the C JNI side).
 SomeGtkClass finalobj = null;
 Boxed obj = Boxed.getBoxedFromHandle(handle);
 if (obj == null) {
     finalobj = new SomeGtkClass(handle);
 } else {
     finalobj = (SomeGtkClass) obj;
 }
 
NOTE: This is for internal use only and should never need to be used in application code.


equals

public boolean equals(java.lang.Object other)
Check if two objects refer to the same (native) object.

Overrides:
equals in class org.gnu.glib.Struct
Parameters:
other - the reference object with which to compare.
Returns:
true if both objects refer to the same object.

hashCode

public int hashCode()
Returns a hash code value for the object. This allows for using Boxed objects as keys in hashmaps.

Overrides:
hashCode in class org.gnu.glib.Struct
Returns:
a hash code value for the object.