Record listener interface

211 views
128 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
211
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • h
  • Record listener interface

    1. 1. Interface RecordListener http://improvejava.blogspot.in
    2. 2. • javax.microedition.rms • public interface RecordListener http://improvejava.blogspot.in
    3. 3. • A listener interface for receiving Record Changed/Added/Deleted events from a record store. http://improvejava.blogspot.in
    4. 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
    5. 5. http://improvejava.blogspot.in
    6. 6. Here I have added one new record which record was not there in previous record store http://improvejava.blogspot.in
    7. 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. 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. 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. 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

    ×