org.utgenome.gwt.utgb.client.util
Class Properties
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,String>
org.utgenome.gwt.utgb.client.util.Properties
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,String>
public class Properties
- extends HashMap<String,String>
This class is an wrapper of the HashMap
, which makes easier to convert associated values with keys into
primitive types, such as int, boolean, String etc.
- Author:
- leo
- See Also:
- Serialized Form
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Properties
public Properties()
Properties
public Properties(Map<String,String> property)
add
public void add(String key,
String value)
add
public void add(String key,
int value)
add
public void add(String key,
long value)
add
public void add(String key,
float value)
add
public void add(String key,
boolean value)
get
public String get(String key)
get
public String get(String key,
String defaultValue)
- Gets the String value associated with the given key. If any corresponding value is not found, returns the default
value.
- Parameters:
key
- the keydefaultValue
- the default value
- Returns:
- the string value
getInt
public int getInt(String key)
getInt
public int getInt(String key,
int defaultValue)
- Gets the integer value associated with the given key. If any corresponding value is not found, returns the given
default value
- Parameters:
key
- defaultValue
-
- Returns:
getFloat
public float getFloat(String key)
getFloat
public float getFloat(String key,
float defaultValue)
- Gets the float value associated with the given key. If any corresponding value is not found, returns the given
default value
- Parameters:
key
- defaultValue
-
- Returns:
getBoolean
public boolean getBoolean(String key)
getBoolean
public boolean getBoolean(String key,
boolean defaultValue)
- Gets the boolean value associated with the given key. If any corresponding value is not found, returns the given
default value
- Parameters:
key
- defaultValue
-
- Returns:
Copyright © 2007-2012 utgenome.org. All Rights Reserved.