OKIEWARDOYO

Java No.13 -1

May 4th, 2012
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. protected void fireFooXXX() {
  2.      // Guaranteed to return a non-null array
  3.      Object[] listeners = listenerList.getListenerList();
  4.      // Process the listeners last to first, notifying
  5.      // those that are interested in this event
  6.      for (int i = listeners.length-2; i>=0; i-=2) {
  7.          if (listeners[i]==FooListener.class) {
  8.              // Lazily create the event:
  9.              if (fooEvent == null)
  10.                  fooEvent = new FooEvent(this);
  11.              ((FooListener)listeners[i+1]).fooXXX(fooEvent);
  12.          }
  13.      }
  14.  }
Advertisement
Add Comment
Please, Sign In to add comment