Class SoundDownload

java.lang.Object
  extended by SoundDownload

public class SoundDownload
extends java.lang.Object

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

record

private Record record
A record from the data file. The SoundDownload doesnt need to know anything about the word data of the record, just the sound resource Url. The class design may be incorrect


startTime

private java.util.Date startTime
The time at which the attempted download was begun


finishTime

private java.util.Date finishTime
The time at which the attempted download was terminated whether successfully or unsuccessfully


soundObject

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


errorMessage

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. These error messages will be important when assessing the quality of the data in the data file and in correcting that data.


wasSuccessful

private boolean wasSuccessful

hasStarted

private boolean hasStarted

hasFinished

private boolean hasFinished
Constructor Detail

SoundDownload

public SoundDownload()

SoundDownload

public SoundDownload(Record dataRecord)
Method Detail

download

public java.lang.String download()
begin the download process.


printStatistics

public java.lang.String printStatistics()
prints information such as the start time, the finish time, the duration and the success or failure of the download.


getSoundObject

public java.applet.AudioClip getSoundObject()

getDownloadTime

public int getDownloadTime()

print

public java.lang.String print()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Hosted by www.Geocities.ws

1