|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolox.event.PNotification
public class PNotification
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.
Field Summary | |
---|---|
protected java.lang.String |
name
Name of the notification. |
protected java.util.Map |
properties
A free form map of properties to attach to this notification. |
protected java.lang.Object |
source
The Object associated with this notification. |
Constructor Summary | |
---|---|
PNotification(java.lang.String name,
java.lang.Object source,
java.util.Map properties)
Creates a notification. |
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 notification, or null if not found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.lang.Object source
protected java.util.Map properties
Constructor Detail |
---|
public PNotification(java.lang.String name, java.lang.Object source, java.util.Map properties)
name
- Arbitrary name of the notificationsource
- object associated with this notificationproperties
- free form map of information about the notificationMethod Detail |
---|
public java.lang.String getName()
public java.lang.Object getObject()
public java.lang.Object getProperty(java.lang.Object key)
key
- key used for looking up the property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |