becker.xtras.nameSurfer
Class SampleNameSurferModel

java.lang.Object
  extended by becker.xtras.nameSurfer.SampleNameSurferModel
All Implemented Interfaces:
IModel, INameSurferModel

public final class SampleNameSurferModel
extends Object
implements IModel, INameSurferModel

The model for the nameSurfer program specifies which names to graph.

Author:
Byron Weber Becker

Constructor Summary
SampleNameSurferModel(INameList nameList)
          Construct a new model.
 
Method Summary
 void addView(IView view)
          Add a view to a list of views.
 void clearGraph()
          Clear the set of names to graph.
 INameInfo[] getNameSet()
          Get the set of names to graph.
 void graphName(String name)
          Find the popularity rankings for the given name and add it to the set of names to graph.
 void removeView(IView view)
          Remove a specific view from the list of views.
 void updateAllViews()
          Update all the views that have been added to this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleNameSurferModel

public SampleNameSurferModel(INameList nameList)
Construct a new model.

Parameters:
nameList - The set of names and their popularity data.
Method Detail

graphName

public void graphName(String name)
Description copied from interface: INameSurferModel
Find the popularity rankings for the given name and add it to the set of names to graph.

Specified by:
graphName in interface INameSurferModel
Parameters:
name - The name to graph.

clearGraph

public void clearGraph()
Description copied from interface: INameSurferModel
Clear the set of names to graph.

Specified by:
clearGraph in interface INameSurferModel

getNameSet

public INameInfo[] getNameSet()
Description copied from interface: INameSurferModel
Get the set of names to graph.

Specified by:
getNameSet in interface INameSurferModel

addView

public void addView(IView view)
Description copied from interface: IModel
Add a view to a list of views. Each view is notified each time an event occurs that changes the state of the model.

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

removeView

public void removeView(IView view)
Description copied from interface: IModel
Remove a specific view from the list of views.

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

updateAllViews

public void updateAllViews()
Description copied from interface: IModel
Update all the views that have been added to this model.

Specified by:
updateAllViews in interface IModel