edu.umd.cs.piccolox.event
Class PNotification

java.lang.Object
  extended by edu.umd.cs.piccolox.event.PNotification

public class PNotification
extends java.lang.Object

PNotification objects encapsulate information so that it can be broadcast to other objects by a PNotificationCenter. A PNotification contains a name, an object, and an optional properties map. The name is a tag identifying the notification. The object is any object that the poster of the notification wants to send to observers of that notification (typically, it is the object that posted the notification). The properties map stores other related objects, if any.

You don't usually create your own notifications directly. The PNotificationCenter method postNotification() allow you to conveniently post a notification without creating it first.

Author:
Jesse Grosjean

Field Summary
protected  java.lang.String name
           
protected  java.util.Map properties
           
protected  java.lang.Object source
           
 
Constructor Summary
PNotification(java.lang.String name, java.lang.Object source, java.util.Map properties)
           
 
Method Summary
 java.lang.String getName()
          Return the name of the notification.
 java.lang.Object getObject()
          Return the object associated with this notification.
 java.lang.Object getProperty(java.lang.Object key)
          Return a property associated with the notfication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

source

protected java.lang.Object source

properties

protected java.util.Map properties
Constructor Detail

PNotification

public PNotification(java.lang.String name,
                     java.lang.Object source,
                     java.util.Map properties)
Method Detail

getName

public java.lang.String getName()
Return the name of the notification. This is the same as the name used to register with the notfication center.


getObject

public java.lang.Object getObject()
Return the object associated with this notification. This is most often the same object that posted the notfication. It may be null.


getProperty

public java.lang.Object getProperty(java.lang.Object key)
Return a property associated with the notfication.



Copyright 2005 by University of Maryland, College Park, MD 20742, USA All rights reserved.

Web Accessibility