cz.muni.fi.pb162.radio
Class UniversalRadio

java.lang.Object
  extended by cz.muni.fi.pb162.radio.UniversalRadio
All Implemented Interfaces:
cz.muni.fi.pb162.radio.Device, cz.muni.fi.pb162.radio.Radio, cz.muni.fi.pb162.radio.SignalReceiver

public class UniversalRadio
extends java.lang.Object
implements cz.muni.fi.pb162.radio.Radio

Universal radio that is possible to build from any parts, provided that they fit the requirements

Version:
20.10.2009
Author:
žuboš Pecho

Constructor Summary
UniversalRadio(cz.muni.fi.pb162.radio.parts.Switchable radioSwitch, cz.muni.fi.pb162.radio.parts.GivingSound speaker, cz.muni.fi.pb162.radio.parts.Displayable display)
          Constructs new instance of Universal radio made off given parts
 
Method Summary
 void decreaseFrequency(double frequency)
          Decreases the frequency by the given value
 void decreaseFrequency(int frequency)
          Decreases the frequency by the given value
 void decreaseVolume()
          Decreases the volume of the radio by one point
 void increaseFrequency(double frequency)
          Increases the frequency by the given value
 void increaseFrequency(int frequency)
          Increases the frequency by the given value
 void increaseVolume()
          Increases the volume of the radio by one point
 void setFrequency(double frequency)
          Sets the frequency, on which the radio should receive signal.
 void turnOff()
          Turns the radio off
 void turnOn()
          Turns the radio on
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniversalRadio

public UniversalRadio(cz.muni.fi.pb162.radio.parts.Switchable radioSwitch,
                      cz.muni.fi.pb162.radio.parts.GivingSound speaker,
                      cz.muni.fi.pb162.radio.parts.Displayable display)
Constructs new instance of Universal radio made off given parts

Parameters:
radioSwitch -
speaker -
display -
Method Detail

decreaseFrequency

public void decreaseFrequency(double frequency)
Decreases the frequency by the given value

Specified by:
decreaseFrequency in interface cz.muni.fi.pb162.radio.SignalReceiver
Parameters:
frequency - the value, by which should be the frequency decreased

decreaseFrequency

public void decreaseFrequency(int frequency)
Decreases the frequency by the given value

Specified by:
decreaseFrequency in interface cz.muni.fi.pb162.radio.SignalReceiver
Parameters:
frequency - the value, by which should be the frequency decreased

decreaseVolume

public void decreaseVolume()
Decreases the volume of the radio by one point

Specified by:
decreaseVolume in interface cz.muni.fi.pb162.radio.Radio

increaseFrequency

public void increaseFrequency(double frequency)
Increases the frequency by the given value

Specified by:
increaseFrequency in interface cz.muni.fi.pb162.radio.SignalReceiver
Parameters:
frequency - the value, by which should be the frequency increased

increaseFrequency

public void increaseFrequency(int frequency)
Increases the frequency by the given value

Specified by:
increaseFrequency in interface cz.muni.fi.pb162.radio.SignalReceiver
Parameters:
frequency - the value, by which should be the frequency increased

increaseVolume

public void increaseVolume()
Increases the volume of the radio by one point

Specified by:
increaseVolume in interface cz.muni.fi.pb162.radio.Radio

setFrequency

public void setFrequency(double frequency)
Sets the frequency, on which the radio should receive signal. Negative frequencies are ignored

Specified by:
setFrequency in interface cz.muni.fi.pb162.radio.SignalReceiver
Parameters:
frequency -

turnOff

public void turnOff()
Turns the radio off

Specified by:
turnOff in interface cz.muni.fi.pb162.radio.Device

turnOn

public void turnOn()
Turns the radio on

Specified by:
turnOn in interface cz.muni.fi.pb162.radio.Device