Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

behavioral::TMutable Class Reference

Inheritance diagram for behavioral::TMutable:

model::TTupleMutable List of all members.

Public Methods

 TMutable ()
void addMutator (IMutator tMUTATOR)
void deleteMutator (IMutator tMUTATOR)
void deleteMutators ()
 Clears the mutator list so that this object no longer has any mutators.

void setNeedMutation ()
int countMutators ()
boolean needMutation ()
void notifyMutators ()
void notifyMutators (Object tARGUMENT)

Protected Methods

void clearNeedMutation ()

Protected Attributes

Vector tMutatorVector
 Vector for mutators.


Detailed Description

Mutable class. This class represents a mutable object. It can be subclassed to represent an object that the application wants to have mutated. A mutable object can have one or more mutators. A mutator may be any object that implements interface IMutator. After a mutable instance needs to be mutated (changed), an application calling the TMutable's notifyMutators method, causes all of its mutators to be notified of the need to be mutated by a call to their update method. The order in which notifications will be delivered is unspecified. The default implementation provided in the TMutable class will notify mutators in the order in which they registered interest, but subclasses may change this order, use no guaranteed order, deliver notifications on separate threads, or may guarantee that their subclass follows this order, as they choose.

When an mutable object is newly created, its set of mutators is empty. Two mutators are considered the same if and only if the equals method returns true for them.

Definition at line 52 of file TMutable.java.


Constructor & Destructor Documentation

behavioral::TMutable::TMutable   [inline]
 

Builds a new instance.

Postcondition:
( countMutators() == 0 )

Definition at line 85 of file TMutable.java.

References behavioral::TMutable::tMutatorVector.


Member Function Documentation

void behavioral::TMutable::addMutator IMutator    tMUTATOR [inline]
 

Adds an mutator to the set of mutators for this object, provided that it is not the same as some mutator already in the set.

Parameters:
tMUTATOR  The mutator to be added.

Definition at line 96 of file TMutable.java.

References behavioral::TMutable::tMutatorVector.

void behavioral::TMutable::clearNeedMutation   [inline, protected]
 

Indicates that this object has no longer need for mutation, or that it has already notified all of its mutators of its most recent change, so that the needMutation method will now return false.

Definition at line 71 of file TMutable.java.

Referenced by behavioral::TMutable::notifyMutators().

int behavioral::TMutable::countMutators   [inline]
 

Returns the number of mutators of this mutable object.

Returns:
The number of mutators.

Definition at line 134 of file TMutable.java.

References behavioral::TMutable::tMutatorVector.

void behavioral::TMutable::deleteMutator IMutator    tMUTATOR [inline]
 

Deletes an mutator from the set of mutators of this object.

Parameters:
tMUTATOR  The mutator to be removed.

Definition at line 105 of file TMutable.java.

References behavioral::TMutable::tMutatorVector.

boolean behavioral::TMutable::needMutation   [inline]
 

Tests if this object need to be mutated.

Returns:
True if this object need to be mutated.

Definition at line 143 of file TMutable.java.

Referenced by behavioral::TMutable::notifyMutators().

void behavioral::TMutable::notifyMutators Object    tARGUMENT [inline]
 

If this object need a mutation, as indicated by the needMutation method, then it notifies all of its mutators and calls the clearNeedMutation method to indicate that this object has no longer need for mutation.

Parameters:
tARGUMENT  An argument passed to the mutator update method.
See also:
IMutator

Definition at line 167 of file TMutable.java.

References behavioral::TMutable::clearNeedMutation(), behavioral::TMutable::needMutation(), and behavioral::TMutable::tMutatorVector.

void behavioral::TMutable::notifyMutators   [inline]
 

If this object need a mutation, as indicated by the needMutation method, then it notifies all of its mutators and calls the clearNeedMutation method to indicate that this object has no longer need for mutation.

Definition at line 154 of file TMutable.java.

void behavioral::TMutable::setNeedMutation   [inline]
 

Marks this mutable object as having been changed; the needMutation method will now return true.

Definition at line 120 of file TMutable.java.


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:35:27 2003 for MPCL by doxygen1.2.18