public class HeartModel extends java.lang.Object implements HeartModelInterface, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
(package private) java.util.ArrayList<BeatObserver> |
beatObservers |
(package private) int |
bpm |
(package private) java.util.ArrayList<BPMObserver> |
bpmObservers |
(package private) java.util.Random |
random |
(package private) java.lang.Thread |
thread |
(package private) int |
time |
Constructor and Description |
---|
HeartModel() |
Modifier and Type | Method and Description |
---|---|
int |
getHeartRate() |
void |
notifyBeatObservers() |
void |
notifyBPMObservers() |
void |
registerObserver(BeatObserver o) |
void |
registerObserver(BPMObserver o) |
void |
removeObserver(BeatObserver o) |
void |
removeObserver(BPMObserver o) |
void |
run() |
java.util.ArrayList<BeatObserver> beatObservers
java.util.ArrayList<BPMObserver> bpmObservers
int time
int bpm
java.util.Random random
java.lang.Thread thread
public HeartModel()
public void run()
run
in interface java.lang.Runnable
public int getHeartRate()
getHeartRate
in interface HeartModelInterface
public void registerObserver(BeatObserver o)
registerObserver
in interface HeartModelInterface
public void removeObserver(BeatObserver o)
removeObserver
in interface HeartModelInterface
public void notifyBeatObservers()
public void registerObserver(BPMObserver o)
registerObserver
in interface HeartModelInterface
public void removeObserver(BPMObserver o)
removeObserver
in interface HeartModelInterface
public void notifyBPMObservers()