becker.util
Class Utilities
java.lang.Object
becker.util.Utilities
public class Utilities
- extends Object
Useful utility methods. Many of these are here to avoid exceptions
until we're ready to understand them.
- Author:
- Byron Weber Becker
Method Summary |
static URL |
getRelativeURL(String relativePath)
Construct a URL relative to the program's working directory. |
static void |
sleep(long milliseconds)
Sleep (pause the program) for the specified number of milliseconds
(a millisecond is 1/1000 of a second -- to sleep for one second, pass
1000 as a parameter). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utilities
public Utilities()
sleep
public static void sleep(long milliseconds)
- Sleep (pause the program) for the specified number of milliseconds
(a millisecond is 1/1000 of a second -- to sleep for one second, pass
1000 as a parameter).
- Parameters:
milliseconds
- How many milliseconds to sleep.
getRelativeURL
public static URL getRelativeURL(String relativePath)
- Construct a URL relative to the program's working directory. For
example, if the current working directory for the program (likely
the directory containing the program's class files) is "C:/myPrograms/"
then
getRelativeURL("ringin.wav")
returns
"file:///C:/myPrograms/ringin.wav" and getRelativeURL("../clips/ringin.wav")
returns "file:///C:/clips/ringin.wav".
- Parameters:
relativePath
- The relative path to the desired resource
- Returns:
- a URL