clock
Class Model

java.lang.Object
  extended by java.util.Observable
      extended by clock.Model

@ClassPreamble(author="Ian Barnes",
               date="01.04.2007",
               currentRevision=2,
               lastModified="29.03.2007",
               lastModifiedBy="abx")
@ToDo(value={"Add date members","Add alarm members"})
public class Model
extends java.util.Observable

The Model class which maintains the value of of hour, minute, second by getting the current instance of java.util.Calendar It serves as Observable clas to Observer View

Author:
Ian Barnes (2005 original version), abx (2007 adopted for a GUI assignment and javadoc tags added)

Field Summary
(package private)  int hour
           
(package private)  int minute
           
(package private)  int oldSecond
           
(package private)  int second
           
 
Constructor Summary
Model()
          creates the model by updating the value of hour, minute, second and notifying the observer (view) of the occured change
 
Method Summary
 void update()
          updates the state of the model by reasigning the values of hour, minute, second and notifying the observer (view) if the change has occured
 
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

hour

int hour

minute

int minute

second

int second

oldSecond

int oldSecond
Constructor Detail

Model

public Model()
creates the model by updating the value of hour, minute, second and notifying the observer (view) of the occured change

Method Detail

update

public void update()
updates the state of the model by reasigning the values of hour, minute, second and notifying the observer (view) if the change has occured