java.lang.ObjectSoundDownload
public class SoundDownload
This class represents a SoundDownload of a language sound. This class will store data about the process of attempting to download the sound resource from the internet. The class will also be responsable for actually initiating the download process by opening a connection to the resource etc. This class should normally run within a thread begun by the DownloadManager class. The SoundDownload can either store the downloaded sound file as an object or it can save the sound to a local file, which is preferable, but possibly not allowed in an applet environment.
| Field Summary | |
|---|---|
private java.lang.String |
errorMessage
will store error messages produced when attempting to download the sound file, such as those produced by the Url class in attempting to make a connection to the sound resource. |
private java.util.Date |
finishTime
The time at which the attempted download was terminated whether successfully or unsuccessfully |
private boolean |
hasFinished
|
private boolean |
hasStarted
|
private Record |
record
A record from the data file. |
private java.applet.AudioClip |
soundObject
A place to store the downloaded sound resource, if the file cannot be saved to the local disk because of security restrictions such as those imposed by an applet |
private java.util.Date |
startTime
The time at which the attempted download was begun |
private boolean |
wasSuccessful
|
| Constructor Summary | |
|---|---|
SoundDownload()
|
|
SoundDownload(Record dataRecord)
|
|
| Method Summary | |
|---|---|
java.lang.String |
download()
begin the download process. |
int |
getDownloadTime()
|
java.applet.AudioClip |
getSoundObject()
|
static void |
main(java.lang.String[] args)
|
java.lang.String |
print()
|
java.lang.String |
printStatistics()
prints information such as the start time, the finish time, the duration and the success or failure of the download. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Record record
private java.util.Date startTime
private java.util.Date finishTime
private java.applet.AudioClip soundObject
private java.lang.String errorMessage
private boolean wasSuccessful
private boolean hasStarted
private boolean hasFinished
| Constructor Detail |
|---|
public SoundDownload()
public SoundDownload(Record dataRecord)
| Method Detail |
|---|
public java.lang.String download()
public java.lang.String printStatistics()
public java.applet.AudioClip getSoundObject()
public int getDownloadTime()
public java.lang.String print()
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception