|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.PropertiesUtils
public class PropertiesUtils
Method Summary | ||
---|---|---|
static Map<String,String> |
asMap(Properties properties)
Tired of Properties not behaving like Map |
|
static void |
checkProperties(Properties properties,
Properties defaults)
Checks to make sure that all properties specified in properties
are known to the program by checking that each simply overrides
a default value |
|
static
|
get(Properties props,
String key,
E defaultValue,
Type type)
Get the value of a property and automatically cast it to a specific type. |
|
static boolean |
getBool(Properties props,
String key)
Load a boolean property. |
|
static boolean |
getBool(Properties props,
String key,
boolean defaultValue)
Load a boolean property. |
|
static double |
getDouble(Properties props,
String key)
Load a double property. |
|
static double |
getDouble(Properties props,
String key,
double defaultValue)
Load a double property. |
|
static double[] |
getDoubleArray(Properties props,
String key)
Loads a comma-separated list of doubles from Properties. |
|
static int |
getInt(Properties props,
String key)
Load an integer property. |
|
static int |
getInt(Properties props,
String key,
int defaultValue)
Load an integer property. |
|
static int[] |
getIntArray(Properties props,
String key)
Loads a comma-separated list of integers from Properties. |
|
static long |
getLong(Properties props,
String key,
long defaultValue)
Load an integer property as a long. |
|
static List<Map.Entry<String,String>> |
getSortedEntries(Properties properties)
|
|
static String[] |
getStringArray(Properties props,
String key)
Loads a comma-separated list of strings from Properties. |
|
static boolean |
hasProperty(Properties props,
String key)
Returns true iff the given Properties contains a property with the given key (name), and its value is not "false" or "no" or "off". |
|
static void |
printProperties(String message,
Properties properties)
|
|
static void |
printProperties(String message,
Properties properties,
PrintStream stream)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean hasProperty(Properties props, String key)
props
- Properties objectkey
- The key to test
public static void printProperties(String message, Properties properties, PrintStream stream)
public static void printProperties(String message, Properties properties)
public static Map<String,String> asMap(Properties properties)
public static List<Map.Entry<String,String>> getSortedEntries(Properties properties)
public static void checkProperties(Properties properties, Properties defaults)
properties
are known to the program by checking that each simply overrides
a default value
properties
- Current propertiesdefaults
- Default properties which lists all known keyspublic static <E> E get(Properties props, String key, E defaultValue, Type type)
public static int getInt(Properties props, String key)
public static int getInt(Properties props, String key, int defaultValue)
public static long getLong(Properties props, String key, long defaultValue)
public static double getDouble(Properties props, String key)
public static double getDouble(Properties props, String key, double defaultValue)
public static boolean getBool(Properties props, String key)
public static boolean getBool(Properties props, String key, boolean defaultValue)
public static int[] getIntArray(Properties props, String key)
public static double[] getDoubleArray(Properties props, String key)
public static String[] getStringArray(Properties props, String key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |