com.niggle.data
Class DataEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.niggle.data.DataEvent
All Implemented Interfaces:
java.io.Serializable

public class DataEvent
extends java.util.EventObject
implements java.io.Serializable

An event that encapsulates something happening in a RecordManager -- the insertion, deletion or updating of a record

Author:
Jonathan Revusky
See Also:
Serialized Form

Field Summary
 Record newRecord
          record being added
 Record oldRecord
          Record being deleted or displaced
static int RECORD_DELETED
          event type for deleting a record
static int RECORD_INSERTED
          event type for inserting a record
static int RECORD_UPDATED
          event type for replacing a record
 int type
          either RECORD_INSERTED, RECORD_DELETED or RECORD_UPDATED
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DataEvent(DataSource source, int type, Record newRecord, Record oldRecord)
          Create a new DataEvent
 
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
 

Field Detail

RECORD_INSERTED

public static final int RECORD_INSERTED
event type for inserting a record

RECORD_DELETED

public static final int RECORD_DELETED
event type for deleting a record

RECORD_UPDATED

public static final int RECORD_UPDATED
event type for replacing a record

type

public final int type
either RECORD_INSERTED, RECORD_DELETED or RECORD_UPDATED

newRecord

public final Record newRecord
record being added

oldRecord

public final Record oldRecord
Record being deleted or displaced
Constructor Detail

DataEvent

public DataEvent(DataSource source,
                 int type,
                 Record newRecord,
                 Record oldRecord)
Create a new DataEvent
Parameters:
source - The RecordManager that is the originator of the event.
type - The type of the event, either DataEvent.RECORD_INSERTED or DataEvent.RECORD_DELETED or DataEvent.RECORD_UPDATED
newRecord - the new record in the case of an insertion or update, null in the case of a deletion.
oldRecord - the old record in the case of a deletion or an update, null in the case of an insertion.