head 1.1; branch 1.1.1; access ; symbols DEVEL:1.1.1.1 HEAD:1.1.1; locks ; strict; comment @# @; 1.1 date 2001.03.16.18.12.23; author jallali; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.03.16.18.12.23; author jallali; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.oti.palmos
Class Callback

    java.lang.Object
      |
      +--com.ibm.oti.palmos.Callback

public class Callback
extends Object

Field Summary
`static Callback` | `NULL` Wrapped constant NULL pointer.
`int` | `pointer`

Constructor Summary
`Callback(int otherPointer)` Constructor to cast from any native function pointer.
`Callback(Object targetObj, String targetMethodName)` Bind a dynamically generated C callback function to a Java method.

Method Summary
`boolean` | `equals(Object other)` Return true if the same native function pointer is wrapped.
`int` | `getCPointer()` Return native address of function bound by this callback.
`int` | `hashCode()` Return hash code for this wrapped native function pointer.
`boolean` | `isNull()` Return true if the wrapped native function pointer is NULL.
`void` | `setCPointer(int addr)` Set this object to a new native callback function address.
`void` | `unbind()` Release this callback.

Methods inherited from class java.lang.Object
`clone, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### pointer

    public int pointer

### NULL

    public static final Callback NULL

  Wrapped constant NULL pointer.

Constructor Detail

### Callback

    public Callback(Object targetObj,
                    String targetMethodName)

  Bind a dynamically generated C callback function to a Java method. Upon a callback the method targetMethodName of targetObj is invoked. If targetObj is an instance of Class the static method targetMethodName is called. The signature of the method with name targetMethodName must be "int targetMethodName(int pointer)". Upon callback a C pointer is passed that points to arguments passed to the dynamically generated C callback function.

### Callback

    public Callback(int otherPointer)

  Constructor to cast from any native function pointer. This constructor does not dynamically generate a C callback function, but sets pointer to a given address.

Method Detail

### setCPointer

    public void setCPointer(int addr)

  Set this object to a new native callback function address. The pointer in this object is simply overwritten by the new one, so call unbind first if required.

### getCPointer

    public int getCPointer()

  Return native address of function bound by this callback.

### isNull

    public boolean isNull()

  Return true if the wrapped native function pointer is NULL.

### hashCode

    public int hashCode()

  Return hash code for this wrapped native function pointer. Two different Callback instances for the same native address. will return the same hash code.
  Overrides:
    hashCode in class Object
  Tags copied from class: Object
  Returns:
    int the receiver's hash.
  See Also:
    `equals`

### equals

    public boolean equals(Object other)

  Return true if the same native function pointer is wrapped.
  Overrides:
    equals in class Object
  Tags copied from class: Object
  Parameters:
    `o` - Object the object to compare with this object.
  Returns:
    boolean `true` if the object is the same as this object `false` if it is different from this object.
  See Also:
    `hashCode`

### unbind

    public void unbind()

  Release this callback. This unbinds the allocated C callback function and the global reference to this java object.

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

@ 1.1.1.1 log @import initial @ text @@