FileDocCategorySizeDatePackage
NativeEvent.javaAPI DocphoneME MR2 API (J2ME)3848Wed May 02 18:00:16 BST 2007com.sun.midp.events

NativeEvent

public class NativeEvent extends Event
This class represents a union of the parameters of all native events.

Since KNI does not allow creation of Java objects an empty object must be create at the Java level to be filled in by the native level. Because the Java level may not know what native event is pending (this to save native method calls) it the object sent down must be able to handle the data of any native event.

Fields Summary
public int
intParam1
First int parameter for the event. Event dependent.
public int
intParam2
Second int parameter for the event. Event dependent.
public int
intParam3
Third int parameter for the event. Event dependent.
public int
intParam4
Fourth int parameter for the event. Event dependent.
public int
intParam5
Fifth int parameter for the event. Event dependent.
public String
stringParam1
First string parameter for the event. Event dependent.
public String
stringParam2
Second string parameter for the event. Event dependent.
public String
stringParam3
Third string parameter for the event. Event dependent.
public String
stringParam4
Third string parameter for the event. Event dependent.
public String
stringParam5
Third string parameter for the event. Event dependent.
public String
stringParam6
Third string parameter for the event. Event dependent.
Constructors Summary
NativeEvent()
Construct a native event.

        /* The native code will fill in the type field. */
        super(0);
    
public NativeEvent(int type)
Construct a native event.

param
type Type ID of the event

        super(type);
    
Methods Summary
public voidclear()
Clears the parameters, so the event can be reused.

        type = 0;

        intParam1 = 0;
        intParam2 = 0;
        intParam3 = 0;
        intParam4 = 0;

        stringParam1 = null;
        stringParam2 = null;
        stringParam3 = null;
        stringParam4 = null;
        stringParam5 = null;
        stringParam6 = null;
    
public java.lang.StringtoString()
Print the event.

return
string containing a list of the parameter values

        return "Native Event: t  = " + type + ", i1 = " + intParam1 +
            ", i2 = " + intParam2 + ", i3 = " + intParam3 +
            ", i4 = " + intParam4 +
            "\n    s1 = " + stringParam1 +
            "\n    s2 = " + stringParam2 +
            "\n    s3 = " + stringParam3 +
            "\n    s4 = " + stringParam4 +
            "\n    s5 = " + stringParam5 +
            "\n    s6 = " + stringParam6;