becker.util
Class ViewList

java.lang.Object
  extended by becker.util.ViewList
All Implemented Interfaces:
IModel

public class ViewList
extends Object
implements IModel

An instance of ViewList is usually used by a class implementing the model part of a model-view-controller to store its list of views. Each time the object's state changes, it should call updateAllViews. This, in turn, calls the updateView method for each of the views stored in the list.

Author:
Byron Weber Becker
See Also:
IView

Constructor Summary
ViewList()
          Construct a new list of Views.
 
Method Summary
 void addView(IView aView)
          Add another View to the list.
 void removeView(IView aView)
          Remove a specific view from the list.
 void removeViews()
          Remove all the views from the list.
 void updateAllViews()
          Notify each of the views on the list that something has happened to the object they are viewing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewList

public ViewList()
Construct a new list of Views.

Method Detail

addView

public void addView(IView aView)
Add another View to the list.

Specified by:
addView in interface IModel
Parameters:
aView - The View to add.

removeView

public void removeView(IView aView)
Remove a specific view from the list.

Specified by:
removeView in interface IModel
Parameters:
aView - The view to remove.

removeViews

public void removeViews()
Remove all the views from the list.


updateAllViews

public void updateAllViews()
Notify each of the views on the list that something has happened to the object they are viewing.

Specified by:
updateAllViews in interface IModel