edu.cmu.hcii.calo.manager.NotificationManager Class Reference

Inherits edu.cmu.hcii.calo.manager.AbstractManager.

Inheritance diagram for edu.cmu.hcii.calo.manager.NotificationManager:

Inheritance graph
[legend]
Collaboration diagram for edu.cmu.hcii.calo.manager.NotificationManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manages the addition, removal, and modifications of notifications as visualized in the notification center.

Author:
Will Haines


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< NotificationnotificationIterator ()
 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< Notificationnotifications
 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.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.manager.NotificationManager.NotificationManager (  )  [private]

Constructs the NotificationManager instance.

Private because this is a singleton.


Member Function Documentation

static NotificationManager edu.cmu.hcii.calo.manager.NotificationManager.getManager (  )  [static]

Returns the singleton instance of this manager.

Returns:
the singleton instance

void edu.cmu.hcii.calo.manager.NotificationManager.addNotification ( Notification  n  ) 

Adds a notification to be managed by the manager.

Parameters:
n the notification to be added

int edu.cmu.hcii.calo.manager.NotificationManager.countNotifications (  ) 

Counts the number of notifications currently being managed.

Returns:
the number of notifications being managed
See also:
java.util.Set.size()

Notification edu.cmu.hcii.calo.manager.NotificationManager.getNotification ( Notification  n  ) 

Gets the given notification in this manager if it exists.

Otherwise, return null.

Parameters:
n the notification to get
Returns:
the notification if it is found, null otherwise

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.

Returns:
the notifications currently in the manager

boolean edu.cmu.hcii.calo.manager.NotificationManager.hasNotification ( Notification  n  ) 

Returns whether or not the manager is managing the given notification.

Parameters:
n the notification to ask about
Returns:
true if the notification is present, false otherwise
See also:
java.util.Set.contains(java.lang.Object)

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.

Parameters:
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.

Parameters:
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.

Returns:
an iterator to the managed notifications
See also:
java.util.Set.iterator()

void edu.cmu.hcii.calo.manager.NotificationManager.removeNotification ( Notification  n  ) 

Removes the given notification from being managed by this manager.

Parameters:
n the notification to remove
See also:
java.util.Set.remove(java.lang.Object)

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.

Parameters:
in the input stream to read from
Exceptions:
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.

Parameters:
out the output stream to write to
Exceptions:
IOException 


Member Data Documentation

final long edu.cmu.hcii.calo.manager.NotificationManager.serialVersionUID = -1008874479493769120L [static, private]

To prevent serialization collisions.

Reimplemented from edu.cmu.hcii.calo.manager.AbstractManager.

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.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:14 2007 for CALO by  doxygen 1.5.2