|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
javoids.SoundMap
public class SoundMap
A class to provide mappings of sound names to sound clips and other functions to support their loading and use.
| Nested Class Summary | |
|---|---|
static class |
SoundMap.Sound
A list of sound names for the game. |
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private static java.util.HashMap<SoundMap.Sound,java.lang.String> |
fileNames
a map of sound names to their file names |
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
private static java.util.HashMap<SoundMap.Sound,javax.sound.sampled.Clip> |
sounds
a map of sound names to the sound clips (the loaded sound files) |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SoundMap()
|
|
| Method Summary | |
|---|---|
javax.sound.sampled.Clip |
getSound(SoundMap.Sound sound)
|
java.lang.String |
getSoundName(SoundMap.Sound sound)
|
java.util.HashMap<SoundMap.Sound,javax.sound.sampled.Clip> |
getSounds()
|
void |
run()
Run a separate thread to load the sounds. |
int |
size()
|
java.lang.String |
toString()
Provide a String representation of this object. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private static java.util.HashMap<SoundMap.Sound,java.lang.String> fileNames
private static java.util.HashMap<SoundMap.Sound,javax.sound.sampled.Clip> sounds
| Constructor Detail |
|---|
public SoundMap()
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic int size()
public javax.sound.sampled.Clip getSound(SoundMap.Sound sound)
sound - the sound name
public java.util.HashMap<SoundMap.Sound,javax.sound.sampled.Clip> getSounds()
public java.lang.String getSoundName(SoundMap.Sound sound)
sound - the sound name
public java.lang.String toString()
toString in class java.lang.Thread
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||