|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object TwoToneCycle
public class TwoToneCycle
Class that represents a two tone cycle, similar to those used in telephone ringbacks.
Constructor Summary | |
---|---|
TwoToneCycle()
Default constructor. |
|
TwoToneCycle(int frequency,
double onTimeInSeconds,
double offTimeInSeconds)
Constructor that takes a single frequency. |
|
TwoToneCycle(int frequency1,
int frequency2,
double onTimeInSeconds,
double offTimeInSeconds)
Constructor that takes two frequencies. |
Method Summary | |
---|---|
double |
getFrequency1()
Accessor method that returns the first frequency |
double |
getFrequency2()
Accessor method that returns the second frequency |
double |
getOffPeriod()
Accessor method that returns the off period |
double |
getOnPeriod()
Accessor method that returns the on period |
Sound |
makeSound()
Method that generates a textbook style Sound object |
void |
setFrequency(int frequency)
Modifier method to set both frequencies to the same value |
void |
setFrequency1(int frequency)
Modifier method to set the first frequency |
void |
setFrequency2(int frequency)
Modifier method to set the second frequency |
void |
setOffPeriod(double timeInSeconds)
Modifier method to set period in which frequences are off (silent) |
void |
setOnPeriod(double timeInSeconds)
Modifier method to set period in which frequences are on (played) |
String |
toString()
Method to return the String representation of this two tone cycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TwoToneCycle()
public TwoToneCycle(int frequency1, int frequency2, double onTimeInSeconds, double offTimeInSeconds)
frequency1
- First frequencyfrequency2
- Second frequencyonTimeInSeconds
- Length of time frequencies are on (played)offTimeInSeconds
- Length of time frequences are off (silent)public TwoToneCycle(int frequency, double onTimeInSeconds, double offTimeInSeconds)
frequency
- FrequencyonTimeInSeconds
- Length of time frequency is on (played)offTimeInSeconds
- Length of time frequency is off (silent)Method Detail |
---|
public void setFrequency1(int frequency)
frequency
- First frequencypublic double getFrequency1()
public void setFrequency2(int frequency)
frequency
- Second frequencypublic double getFrequency2()
public void setFrequency(int frequency)
frequency
- Frequency (both first and second)public void setOnPeriod(double timeInSeconds)
timeInSeconds
- time for the on period (in seconds)public double getOnPeriod()
public void setOffPeriod(double timeInSeconds)
timeInSeconds
- time for the off period (in seconds)public double getOffPeriod()
public String toString()
toString
in class Object
public Sound makeSound()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |