3. • A listener interface for receiving Record
Changed/Added/Deleted events from a record
store.
http://improvejava.blogspot.in
4. • If a record store is changed, then
RecordListener interface notifies its
implementation class about the changes made
to the recordstore.
• For example I have a record store like follows
http://improvejava.blogspot.in
6. Here I have added one new record which
record was not there in previous record store
http://improvejava.blogspot.in
7. • So this added information is notified to
implementation class.
Class Ex implements RecordListener
{
}
• Here RecordListener informs the modification
to class Ex
http://improvejava.blogspot.in
8. • There are 3 events are there
1. Record added: when this event occurs, the
recordAdded() method of RecordListener is
involved.
2. RecordDeleted(): this event occurs when the
RecordDeleted() method invoked
3. when we modify any record, then
recordChanged() method will be executed
• These methods are member of RecordListener
http://improvejava.blogspot.in
9. Where should we use?
• When a class want to notify of the changes in
record store, then it must implement the
three methods of RecordListener.
• A record listener can be added following
syntax:
• Rec.addRecordListener(new Ex());//here rec is
ref of recordstore, Ex is class to be notified
http://improvejava.blogspot.in
10. Methods
Void recordAdded(RecordStore recordStore, int recordId)
• Called when a record has been added to a record store.
Void recordChanged(RecordStore recordStore, int recordId)
• Called after a record in a record store has been changed.
Void recordDeleted(RecordStore recordStore, int recordId)
Called after a record has been deleted from a record store.
http://improvejava.blogspot.in