|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.speech.freetts.util.Utilities
Provides a set of generic utilities used by freetts.
Method Summary | |
static void |
debug(java.lang.String string)
A very simple debug log mechanism. |
static java.lang.String |
deleteChar(java.lang.String fromString,
char charToDelete)
Removes all instances of the specified character from the given String. |
static void |
dump(java.io.PrintWriter pw,
int padding,
java.lang.String string)
Dumps padded text. |
static boolean |
getBoolean(java.lang.String name)
Gets a boolean property by name. |
static java.io.InputStream |
getInputStream(java.net.URL url)
Returns an input stream for the given URL. |
static java.lang.Integer |
getInteger(java.lang.String name,
int defaultValue)
Gets an Integer property by name. |
static java.lang.Long |
getLong(java.lang.String name,
long defaultValue)
Gets a long property by name. |
static java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Gets a property by name and returns its value. |
static java.lang.String |
getString(java.nio.ByteBuffer bb)
Inputs a string from a ByteBuffer. |
static java.lang.String |
getString(java.io.DataInputStream dis)
Inputs a string from a DataInputStream. |
static void |
outString(java.io.DataOutputStream dos,
java.lang.String s)
Outputs a string to the given stream. |
static java.lang.String |
pad(int padding)
Returns a string with the given number of spaces. |
static java.lang.String |
pad(java.lang.String string,
int minLength)
Pads with spaces or truncates the given string to guarantee that it is exactly the desired length. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.String pad(int padding)
padding
- the number of spaces in the string
public static java.lang.String pad(java.lang.String string, int minLength)
string
- the string to be paddedminLength
- the desired length of the string
public static java.lang.String deleteChar(java.lang.String fromString, char charToDelete)
fromString
- the String to delete characters fromcharToDelete
- the character to delete from the given String
public static void dump(java.io.PrintWriter pw, int padding, java.lang.String string)
pw
- the stream to send the outputpadding
- the number of spaces in the stringstring
- the string to outputpublic static java.io.InputStream getInputStream(java.net.URL url) throws java.io.IOException
url
- the url to open as a stream
java.io.IOException
- if there is trouble creating the streampublic static void outString(java.io.DataOutputStream dos, java.lang.String s) throws java.io.IOException
dos
- the streams
- the string to output
java.io.IOException
- if an I/O error occurspublic static java.lang.String getString(java.io.DataInputStream dis) throws java.io.IOException
dis
- the stream
java.io.IOException
- if an I/O error occurspublic static java.lang.String getString(java.nio.ByteBuffer bb) throws java.io.IOException
bb
- the input byte buffer
java.io.IOException
- if an I/O error occurspublic static java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
name
- the name of the propertydefaultValue
- the default value to use if the property
cannot be found.
public static boolean getBoolean(java.lang.String name)
name
- the name of the property
public static java.lang.Long getLong(java.lang.String name, long defaultValue)
name
- the name of the propertydefaultValue
- the default value to use if the property
cannot be found.
public static java.lang.Integer getInteger(java.lang.String name, int defaultValue)
name
- the name of the propertydefaultValue
- the default value to use if the property
cannot be found.
public static void debug(java.lang.String string)
freetts.debug
is true
, print the string to
stderr; else, dont.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |