|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object becker.xtras.radio.Radio becker.xtras.radio.SampleTuner
public final class SampleTuner
A class implementing ITuner
, to be used to demonstrate
the code students are to write to work with RadioGUI
.
Field Summary |
---|
Fields inherited from interface becker.xtras.radio.ITuner |
---|
NUM_PRESETS |
Constructor Summary | |
---|---|
SampleTuner(double low,
double high,
double freqChange)
|
Method Summary | |
---|---|
void |
addView(IView aView)
Add a view (graphical user interface) to the tuner. |
void |
recallFrequency(int button)
Recall the frequency associated with a given preset button by a previous call to ITuner.rememberFrequency(int) . |
void |
rememberFrequency(int button)
Remember the current frequency so that it can be later recalled with ITuner.recallFrequency(int) . |
void |
seekDown()
Move the frequency down until a station is found with a signal strength of at least 0.5. |
void |
seekUp()
Move the frequency up until a station is found with a signal strength of at least 0.5. |
void |
setFrequency(double freq)
Set this radio's current frequency. |
void |
tuneDown()
Move the frequency one step down, unless the frequency is already at the lowest value for this band. |
void |
tuneUp()
Move the frequency one step up, unless the frequency is already at the highest value for this band. |
Methods inherited from class becker.xtras.radio.Radio |
---|
getFrequency, getSignalStrength |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface becker.xtras.radio.ITuner |
---|
getFrequency, getSignalStrength |
Constructor Detail |
---|
public SampleTuner(double low, double high, double freqChange)
Method Detail |
---|
public void tuneUp()
ITuner
tuneUp
in interface ITuner
public void tuneDown()
ITuner
tuneDown
in interface ITuner
public void seekUp()
ITuner
seekUp
in interface ITuner
public void seekDown()
ITuner
seekDown
in interface ITuner
public void rememberFrequency(int button)
ITuner
ITuner.recallFrequency(int)
. There are a possible NUM_PRESETS
remembered frequencies, each assigned to a button in the user interface.
rememberFrequency
in interface ITuner
button
- The number of a preset frequency button. Between 1 and
NUM_PRESETS, inclusive.public void recallFrequency(int button)
ITuner
ITuner.rememberFrequency(int)
. Set the recalled frequency
to be the current frequency. There are a possible NUM_PRESETS
remembered frequencies, each assigned to a button in the user interface.
recallFrequency
in interface ITuner
button
- The number of a preset frequency button. Between 1 and
NUM_PRESETS, inclusive.public void setFrequency(double freq)
Radio
setFrequency
in class Radio
freq
- The new frequency for this radio.public void addView(IView aView)
ITuner
updateView
method must be called each time the tuner's state changes.
addView
in interface ITuner
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |