edu.stanford.rt.util
Class RTUtil
java.lang.Object
|
+--edu.stanford.rt.util.RTUtil
- public class RTUtil
- extends java.lang.Object
- Author:
- Ninghui Li, Sandra Qiu
Utility class
Field Summary |
private static boolean |
DEBUG
|
private static java.io.PrintStream |
out
|
Method Summary |
static void |
debugInfo(java.lang.String s)
Method debugInfo. |
static boolean |
parseBoolean(java.lang.String attrValue,
boolean defValue)
Method parseBoolean. |
static int |
parseInt(java.lang.String attrValue,
int defValue)
Method parseInt. |
static long |
parseLong(java.lang.String attrValue,
long defValue)
Method parseLong. |
static void |
setOutputStream(java.io.PrintStream out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
private static java.io.PrintStream out
DEBUG
private static boolean DEBUG
RTUtil
public RTUtil()
setOutputStream
public static void setOutputStream(java.io.PrintStream out)
debugInfo
public static void debugInfo(java.lang.String s)
- Method debugInfo.
- Parameters:
s
-
parseLong
public static long parseLong(java.lang.String attrValue,
long defValue)
- Method parseLong.
parses the given attribute value as a long. If attrValue cannot
be correctly parsed, then returns the given default value.
- Parameters:
attrValue
- the string to be parsed.defValue
- the default value
- Returns:
- long
parseInt
public static int parseInt(java.lang.String attrValue,
int defValue)
- Method parseInt.
parses the given attribute value as an integer. If the attrValue
cannot be correctly parsed, returns the given default value.
- Parameters:
attrValue
- the string to be parsed.defValue
- the default value.
- Returns:
- int
parseBoolean
public static boolean parseBoolean(java.lang.String attrValue,
boolean defValue)
- Method parseBoolean.
parses the given attribute value as a boolean.
If attrValue is null or an empty string, return the
given default value.
- Parameters:
attrValue
- the string to be parsed.defValue
- the default value
- Returns:
- boolean