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

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

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

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Manages the addition of items to a persistant history as displayed in the learning log.

The history manager just manages messages since all the things that we want to track are the results of specific messages. The engine will interact with this manager directly to add the messages and the controller will access it directly because there is nothing to model past the list since we only support adding things.

Author:
Will Haines


Public Member Functions

boolean addHistoryItem (HistoryItem h)
 Adds a history item to be managed by the manager.
int countHistoryItems ()
 Counts the number of history items currently being managed.
boolean hasHistoryItem (HistoryItem h)
 Returns whether or not the manager is managing the given history item.
Iterator< HistoryItemiterator ()
 Returns an iterator, sorted by add time, over the history items managed by the manager.
void reset ()
 Resets this manager back to the way it was when it was first created.

Static Public Member Functions

static HistoryManager getManager ()
 Returns the singleton instance of this manager.

Private Member Functions

 HistoryManager ()
 Constructs the HistoryManager 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

List< HistoryItemhistory
 The notifications, sorted by priority.

Static Private Attributes

static final long serialVersionUID = 458809417869277326L
 Prevent serialization collisions.
static HistoryManager uniqueInstance = null
 The singleton instance of the notification manager.


Constructor & Destructor Documentation

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

Constructs the HistoryManager instance.

Private because this is a singleton.


Member Function Documentation

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

Returns the singleton instance of this manager.

Returns:
the singleton instance

boolean edu.cmu.hcii.calo.manager.HistoryManager.addHistoryItem ( HistoryItem  h  ) 

Adds a history item to be managed by the manager.

Parameters:
h the history item to be added

int edu.cmu.hcii.calo.manager.HistoryManager.countHistoryItems (  ) 

Counts the number of history items currently being managed.

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

boolean edu.cmu.hcii.calo.manager.HistoryManager.hasHistoryItem ( HistoryItem  h  ) 

Returns whether or not the manager is managing the given history item.

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

Iterator<HistoryItem> edu.cmu.hcii.calo.manager.HistoryManager.iterator (  ) 

Returns an iterator, sorted by add time, over the history items managed by the manager.

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

void edu.cmu.hcii.calo.manager.HistoryManager.reset (  ) 

Resets this manager back to the way it was when it was first created.

void edu.cmu.hcii.calo.manager.HistoryManager.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.HistoryManager.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.HistoryManager.serialVersionUID = 458809417869277326L [static, private]

Prevent serialization collisions.

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

HistoryManager edu.cmu.hcii.calo.manager.HistoryManager.uniqueInstance = null [static, private]

The singleton instance of the notification manager.

List<HistoryItem> edu.cmu.hcii.calo.manager.HistoryManager.history [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