001package headfirst.combined.djview; 002 003public class HeartAdapter implements BeatModelInterface { 004 HeartModelInterface heart; 005 006 public HeartAdapter(HeartModelInterface heart) { 007 this.heart = heart; 008 } 009 010 public void initialize() {} 011 012 public void on() {} 013 014 public void off() {} 015 016 public int getBPM() { 017 return heart.getHeartRate(); 018 } 019 020 public void setBPM(int bpm) {} 021 022 public void registerObserver(BeatObserver o) { 023 heart.registerObserver(o); 024 } 025 026 public void removeObserver(BeatObserver o) { 027 heart.removeObserver(o); 028 } 029 030 public void registerObserver(BPMObserver o) { 031 heart.registerObserver(o); 032 } 033 034 public void removeObserver(BPMObserver o) { 035 heart.removeObserver(o); 036 } 037}