edu.cmu.hcii.calo.model.ManagedObject Class Reference

Inherited by edu.cmu.hcii.calo.model.HistoryItem, edu.cmu.hcii.calo.model.Pack, edu.cmu.hcii.calo.model.PrioritizedObject, and edu.cmu.hcii.calo.model.ScheduleItem.

Inheritance diagram for edu.cmu.hcii.calo.model.ManagedObject:

Inheritance graph
[legend]
List of all members.

Detailed Description

Represents an object that is designed to be managed by one of CALO's manager classes.

Author:
Brian Ellis


Public Member Functions

boolean equals (Object obj)
 Tests if an object is equal to this managed object.
boolean isCaloAdded ()
 Accessor method for whether or not this item was added by the AI engine.
Calendar getDateAdded ()
 Accessor method for dateAdded.
int hashCode ()
 Returns a hash code for this managed object.
boolean isManaged ()
 Accessor method for isManaged.
void setId (int id)
 Sets the ID of this managed object.
void setManaged (boolean isManaged)
 Setter method for isManaged.

Protected Member Functions

int getId ()
 Accessor method for id.
void setCaloAdded (boolean caloAdded)
 Setter method for caloAdded.
void setDateAdded (Calendar dateAdded)
 Setter method for dateAdded.

Private Attributes

boolean isManaged = false
 Whether or not this object is currently managed by a manager.
boolean caloAdded
 Was this item added by the AI engine?
Calendar dateAdded
 The date on which this item was added.
int id = -1
 The unique id of this item for lookup in its manager.


Member Function Documentation

boolean edu.cmu.hcii.calo.model.ManagedObject.equals ( Object  obj  ) 

Tests if an object is equal to this managed object.

If the object is unmanaged, it is just a reference equals. If this object is managed, then we compare unique management ids to determine equality. Don't assume something else; you will be wrong.

Parameters:
obj the object to test equality with
Returns:
true if these objects are equal, false otherwise
See also:
java.lang.Object.equals(java.lang.Object)

boolean edu.cmu.hcii.calo.model.ManagedObject.isCaloAdded (  ) 

Accessor method for whether or not this item was added by the AI engine.

Returns:
true if added by CALO

Calendar edu.cmu.hcii.calo.model.ManagedObject.getDateAdded (  ) 

Accessor method for dateAdded.

Returns:
the value of dateAdded

Reimplemented in edu.cmu.hcii.calo.model.TaskGroup.

int edu.cmu.hcii.calo.model.ManagedObject.hashCode (  ) 

Returns a hash code for this managed object.

If the object is unmanaged, it is a reference hash; otherwise, it is based on the unique management id. Don't assume otherwise; you will be wrong.

Returns:
a hash code for this object
See also:
java.lang.Object.hashCode()

boolean edu.cmu.hcii.calo.model.ManagedObject.isManaged (  ) 

Accessor method for isManaged.

Returns:
the value of isManaged

void edu.cmu.hcii.calo.model.ManagedObject.setId ( int  id  ) 

Sets the ID of this managed object.

This should be called by the manager managing this object, and ensures that its equals() and hashCode() methods will continue to work if it is serialized and deserialized somewhere else.

Parameters:
id the new ID of this object

void edu.cmu.hcii.calo.model.ManagedObject.setManaged ( boolean  isManaged  ) 

Setter method for isManaged.

Parameters:
isManaged the isManaged to set

int edu.cmu.hcii.calo.model.ManagedObject.getId (  )  [protected]

Accessor method for id.

Returns:
the value of id

void edu.cmu.hcii.calo.model.ManagedObject.setCaloAdded ( boolean  caloAdded  )  [protected]

Setter method for caloAdded.

Parameters:
caloAdded the caloAdded to set

void edu.cmu.hcii.calo.model.ManagedObject.setDateAdded ( Calendar  dateAdded  )  [protected]

Setter method for dateAdded.

Parameters:
dateAdded the dateAdded to set


Member Data Documentation

boolean edu.cmu.hcii.calo.model.ManagedObject.isManaged = false [private]

Whether or not this object is currently managed by a manager.

(When objects are created, they are not managed, and changes to the object will not be propagated to any controllers.)

boolean edu.cmu.hcii.calo.model.ManagedObject.caloAdded [private]

Was this item added by the AI engine?

Calendar edu.cmu.hcii.calo.model.ManagedObject.dateAdded [private]

The date on which this item was added.

int edu.cmu.hcii.calo.model.ManagedObject.id = -1 [private]

The unique id of this item for lookup in its manager.


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