ITSE 2317 OOP Callbacks - I Lesson # 077 Run: Mon May 21 12:19:52 CDT 2012 Baldwin Slides aa - ITSE 2317 Java Programming (Intermediate) ab - Callbacks - I ac - Figures ad - Listings ae - What is a callback? af - What is an Interesting event? ag - What is unicasting? ah - What is multicasting? ai - Java uses many different forms of callback aj - Callbacks in other languages such as C ak - Java doesn't support pure C-style pointers al - Setting the stage am - Start simple an - Registering for rollcall ao - From simple to more complex ap - Miscellany aq - Unicast Sample Program ar - Purpose of program as - Keeping it simple at - Defining a CallBack interface au - The callBack() method av - The Teacher class aw - Why only one object? ax - The Student class ay - How are they notified? az - What does callBack method do? ba - The controlling class bb - Will explain in fragments bc - Define the CallBack interface bd - Sources and listeners be - Registration bf - Name the source class: Teacher bg - Teacher class definition bh - A simple class bi - What do the two methods do? bj - Objects on list have callBack method bk - Listener class bl - Name the listener class Student bm - Student class definition bn - Behavior of the callBack method bo - Definition of the controlling class bp - Behavior of the controlling class named Callback01 bq - The main method br - Invoking callTheRoll bs - A standard Java approach bt - Multicast Sample Program bu - Program structure bv - A list of registered objects bw - Has multicast behavior bx - Mixed listener types by - Subtle but very important point bz - The CallBack interface ca - The callBack method... cb - Teacher class cc - Size of the list cd - Student class and Dog class ce - Registering objects for callback cf - Addition and removal cg - Notification procedure ch - To keep things simple... ci - Miscellany cj - A controlling class ck - Multicast code fragments cl - CallBack interface definition cm - Define source class cn - Name the source class Teacher. co - Lots of new material here cp - Declare Vector to contain the list cq - Contents of type Object cr - Constructor for Teacher cs - Registration method ct - A synchronized method cu - Incoming parameter type cv - Store reference in the list cw - Removing listener objects from the list cx - The removeElement method cy - The unRegister method cz - Attempt to remove listener object da - Notification method db - The method named callTheRoll dc - Protecting against potential problems dd - Protecting against potential problems (cont'd) de - Notify registered listeners df - The end of the class named Teacher dg - The class named Student dh - The class named Dog di - The Dog class dj - A different message dk - The controlling class named Callback02 dl - The controlling class (cont'd) dm - Numerous display statements dn - Achieving callbacks do - Subtle, but extremely important points dp - Must implement the CallBack interface dq - Program output dr - Program output (cont'd) ds - Program output (cont'd) dt - Complete program listings du - The End |
-end-