Inheritance diagram for edu.cmu.hcii.calo.manager.NotificationManager:
Public Member Functions | |
void | addNotification (Notification n) |
Adds a notification to be managed by the manager. | |
int | countNotifications () |
Counts the number of notifications currently being managed. | |
Notification | getNotification (Notification n) |
Gets the given notification in this manager if it exists. | |
Notification[] | getNotifications () |
Returns an array containing all the notifications in the manager. | |
boolean | hasNotification (Notification n) |
Returns whether or not the manager is managing the given notification. | |
void | noteNotificationPriorityChanged (Notification n, double oldPriority, double newPriority) |
Called by a notification when its priority is changed so that the manager can notify all interested parties of the change. | |
void | noteNotificationTextChanged (Notification n, String oldText, String newText) |
Called by a notification when its text is changed so that the manager can notify all interested parties of the change. | |
Iterator< Notification > | notificationIterator () |
Returns an iterator, sorted by priority, over the notifications managed by the manager. | |
void | removeNotification (Notification n) |
Removes the given notification from being managed by this manager. | |
void | reset () |
Resets this manager back to the way it was when it was first created. | |
Static Public Member Functions | |
static NotificationManager | getManager () |
Returns the singleton instance of this manager. | |
Private Member Functions | |
NotificationManager () | |
Constructs the NotificationManager instance. | |
void | readObject (java.io.ObjectInputStream in) throws IOException, ClassNotFoundException |
Reads in a serialized manager. | |
void | writeObject (java.io.ObjectOutputStream out) throws IOException |
Writes this manager to stream. | |
Private Attributes | |
MutableSortedSet< Notification > | notifications |
The notifications, sorted by priority. | |
Static Private Attributes | |
static final long | serialVersionUID = -1008874479493769120L |
To prevent serialization collisions. | |
static NotificationManager | uniqueInstance = null |
The singleton instance of the notification manager. |
edu.cmu.hcii.calo.manager.NotificationManager.NotificationManager | ( | ) | [private] |
Constructs the NotificationManager instance.
Private because this is a singleton.
static NotificationManager edu.cmu.hcii.calo.manager.NotificationManager.getManager | ( | ) | [static] |
Returns the singleton instance of this manager.
void edu.cmu.hcii.calo.manager.NotificationManager.addNotification | ( | Notification | n | ) |
Adds a notification to be managed by the manager.
n | the notification to be added |
int edu.cmu.hcii.calo.manager.NotificationManager.countNotifications | ( | ) |
Counts the number of notifications currently being managed.
Notification edu.cmu.hcii.calo.manager.NotificationManager.getNotification | ( | Notification | n | ) |
Gets the given notification in this manager if it exists.
Otherwise, return null.
n | the notification to get |
Notification [] edu.cmu.hcii.calo.manager.NotificationManager.getNotifications | ( | ) |
Returns an array containing all the notifications in the manager.
Use this instead of notificationIterator() to avoid concurrent modification due to threading issues, if that's your thing.
boolean edu.cmu.hcii.calo.manager.NotificationManager.hasNotification | ( | Notification | n | ) |
Returns whether or not the manager is managing the given notification.
n | the notification to ask about |
void edu.cmu.hcii.calo.manager.NotificationManager.noteNotificationPriorityChanged | ( | Notification | n, | |
double | oldPriority, | |||
double | newPriority | |||
) |
Called by a notification when its priority is changed so that the manager can notify all interested parties of the change.
n | the notification that has been altered | |
oldPriority | the former priority of this task | |
newPriority | the new priority of this task |
void edu.cmu.hcii.calo.manager.NotificationManager.noteNotificationTextChanged | ( | Notification | n, | |
String | oldText, | |||
String | newText | |||
) |
Called by a notification when its text is changed so that the manager can notify all interested parties of the change.
n | the notification that has been altered | |
oldText | the former text of this notification | |
newText | the new text of this notification |
Iterator<Notification> edu.cmu.hcii.calo.manager.NotificationManager.notificationIterator | ( | ) |
Returns an iterator, sorted by priority, over the notifications managed by the manager.
void edu.cmu.hcii.calo.manager.NotificationManager.removeNotification | ( | Notification | n | ) |
Removes the given notification from being managed by this manager.
n | the notification to remove |
void edu.cmu.hcii.calo.manager.NotificationManager.reset | ( | ) |
Resets this manager back to the way it was when it was first created.
void edu.cmu.hcii.calo.manager.NotificationManager.readObject | ( | java.io.ObjectInputStream | in | ) | throws IOException, ClassNotFoundException [private] |
Reads in a serialized manager.
Just checks against the serialVersionUID.
in | the input stream to read from |
IOException | ||
ClassNotFoundException |
void edu.cmu.hcii.calo.manager.NotificationManager.writeObject | ( | java.io.ObjectOutputStream | out | ) | throws IOException [private] |
Writes this manager to stream.
Since I don't want to deal with everything below this manager being serialized and it is a singleton, I just write the ID for error checking.
out | the output stream to write to |
IOException |
final long edu.cmu.hcii.calo.manager.NotificationManager.serialVersionUID = -1008874479493769120L [static, private] |
NotificationManager edu.cmu.hcii.calo.manager.NotificationManager.uniqueInstance = null [static, private] |
The singleton instance of the notification manager.
MutableSortedSet<Notification> edu.cmu.hcii.calo.manager.NotificationManager.notifications [private] |
The notifications, sorted by priority.