|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--mvp.Model
Class Model is an abstract parent class for model classes in an MVP design. See Fisher SE lecture notes for further discussion of the MVP design methodology.
Field Summary | |
protected View |
view
The canonical view for this model. |
Constructor Summary | |
Model()
Construct a model with no view. |
|
Model(View view)
Construct a model with the given View. |
Method Summary | |
java.lang.String |
dump()
Dump the entire contents of this in String form. |
void |
exit()
Perform appropriate exit processing, which typically includes exiting the application program of which this model is a component. |
View |
getView()
Return the view of this. |
void |
setView(View v)
Set the view of this to the given view, if the view is not already set. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected View view
Constructor Detail |
public Model(View view)
post: this'.view = view;
public Model()
post: this'.view = null;
Method Detail |
public void setView(View v)
Models with multiple and/or dynamically changeable views must manage view changes with additional data members. This' canonical view can be set only once, with either the constructor or one call to setView.
pre: this.view == null; post: this'.view == view;
public View getView()
post: return == view;
public void exit()
post: ; // must be specialized in subclasses
public java.lang.String dump()
post: ; // must be specialized in subclasses
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |