org.zaval.util.event
Class EvObject

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.zaval.util.event.EvObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LwTrackerEvent, MatrixEvent, TextEvent, TreeEvent

public abstract class EvObject
extends java.util.EventObject

This abstract class represents an event that has unique integer identifier. You can inherit the class to create own event classes that may be identified by an integer id.

See Also:
Serialized Form

Fields inherited from class java.util.EventObject
source
 
Constructor Summary
EvObject(java.lang.Object src, int id)
          Constructs the event object with the specified source object and the event id.
 
Method Summary
protected abstract  boolean checkID(int id)
          The method returns true if the specified id is valid for the event, otherwise returns false.
 int getID()
          Gets the event id.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EvObject

public EvObject(java.lang.Object src,
                int id)
Constructs the event object with the specified source object and the event id.
Parameters:
src - the object where the event originated.
id - the specified event id.
Method Detail

getID

public int getID()
Gets the event id.
Returns:
an event id.

checkID

protected abstract boolean checkID(int id)
The method returns true if the specified id is valid for the event, otherwise returns false. The method is called with the event constructor to test if the event id is valid and if the event is not valid the IllegalArgumentException will be thrown.
Parameters:
id - the specified id.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org