|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.TreeMap<Object,Object>
gate.util.OptionsMap
public class OptionsMap
A map that stores values as strings and provides support for converting some
frequently used types to and from string.
Not very efficient as there is a lot of conversions from/to String.
The conversion could happen only when loading/saving from/to a file.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
OptionsMap()
|
|
| Method Summary | |
|---|---|
Boolean |
getBoolean(Object key)
If the object stored under key is a Boolean then returns its value otherwise returns false. |
Double |
getDouble(Object key)
If the object stored under key is an Double then returns its value otherwise returns null. |
Font |
getFont(Object key)
If the object stored under key is a Font then returns its value otherwise returns null. |
Integer |
getInt(Object key)
If the object stored under key is an Integer then returns its value otherwise returns null. |
List<String> |
getList(Object key)
If the object stored under key is a list then returns its value otherwise returns an empty list. |
Map<String,String> |
getMap(Object key)
If the object stored under key is a map then returns its value otherwise returns an empty map. |
String |
getString(Object key)
If the object stored under key is a String then returns its value otherwise returns null. |
Object |
put(Object key,
List<String> value)
|
Object |
put(Object key,
Map<String,String> value)
|
Object |
put(Object key,
Object value)
Converts the value to string using Strings.toString(Object)
method and then stores it. |
| Methods inherited from class java.util.TreeMap |
|---|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, putAll, remove, size, subMap, subMap, tailMap, tailMap, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, isEmpty, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode, isEmpty |
| Constructor Detail |
|---|
public OptionsMap()
| Method Detail |
|---|
public Object put(Object key,
Object value)
Strings.toString(Object)
method and then stores it.
There is get methods for values that are a String, an Integer, a Boolean,
a Font, a List of String and a Map of String*String.
put in interface Map<Object,Object>put in class TreeMap<Object,Object>
public Object put(Object key,
List<String> value)
public Object put(Object key,
Map<String,String> value)
public Integer getInt(Object key)
key - key associated to the value to retrieve
public Double getDouble(Object key)
key - key associated to the value to retrieve
public Boolean getBoolean(Object key)
key - key associated to the value to retrieve
public String getString(Object key)
key - key associated to the value to retrieve
public Font getFont(Object key)
key - key associated to the value to retrieve
public List<String> getList(Object key)
key - key associated to the value to retrieve
public Map<String,String> getMap(Object key)
key - key associated to the value to retrieve
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||