001package headfirst.facade.hometheater; 002 003public class Tuner { 004 String description; 005 Amplifier amplifier; 006 double frequency; 007 008 public Tuner(String description, Amplifier amplifier) { 009 this.description = description; 010 } 011 012 public void on() { 013 System.out.println(description + " on"); 014 } 015 016 public void off() { 017 System.out.println(description + " off"); 018 } 019 020 public void setFrequency(double frequency) { 021 System.out.println(description + " setting frequency to " + frequency); 022 this.frequency = frequency; 023 } 024 025 public void setAm() { 026 System.out.println(description + " setting AM mode"); 027 } 028 029 public void setFm() { 030 System.out.println(description + " setting FM mode"); 031 } 032 033 public String toString() { 034 return description; 035 } 036}