|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.util.PropertyMap
A map which provides convenient setXYZ() and getXYZ() methods for setting and
returning values of type XYZ, given String keys. In addition,
${foo.bar} is replaced by the value of the property
foo.bar when a value is returned in one of the getXYZ()
methods.
The map can be configured so that it can hold multiple values for a key. The
methods inhereted from java.util.Map then operate on the first
stored value, unless otherwise noted.
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
protected boolean |
multipleValues
A flag specifying if multiple values can be hold for a key. |
| Constructor Summary | |
PropertyMap()
Creates a new instance with only one value per key. |
|
PropertyMap(boolean multipleValues)
Creates a new instance. |
|
| Method Summary | |
void |
addDouble(double d)
Adds the specified number to each value (considered as a double). |
void |
addDouble(java.lang.Object key,
double d)
Adds the specified number to the value (as a double) for the specified key. |
void |
addDouble(PropertyMap map)
Adds each value (as a double) in the specified map to the corresponding value in this map, for each key occurring in the specified map. |
void |
addInt(int i)
Adds the specified number to each value (considered as an integer). |
void |
addInt(java.lang.Object key,
int i)
Adds the specified number to the value (as an integer) for the specified key. |
void |
addInt(PropertyMap map)
Adds each value (as an integer) in the specified map to the corresponding value in this map, for each key occurring in the specified map. |
void |
apply(Function func)
Applies the specified function on every value (considered as a double), and replaces the original value. |
java.lang.String |
convertString(java.lang.Object value,
PropertyMap map)
Returns the specified String value, using another map from where values can be taken while converting. |
void |
divDouble(double d)
Divides each value (considered as a double) by the specified number. |
void |
divDouble(java.lang.Object key,
double d)
Divides the value (considered as a double) for the specified key by the specified number. |
void |
divDouble(PropertyMap map)
Divides each value (as a double) by the corresponding value in the specified map, for each key occurring in the specified map. |
void |
divInt(int i)
Divides each value (considered as an integer) by the specified number. |
void |
divInt(java.lang.Object key,
int i)
Divides the value (considered as an integer) for the specified key by the specified number. |
void |
divInt(PropertyMap map)
Divides each value (as an integer) by the corresponding value in the specified map, for each key occurring in the specified map. |
abstract java.util.List |
getAll(java.lang.Object key)
Returns a list with all values stored for the specified key. |
boolean |
getBoolean(java.lang.Object key)
Returns the boolean value of the specified key. |
double |
getDouble(java.lang.Object key)
Returns the double value of the specified key. |
int |
getInt(java.lang.Object key)
Returns the int value of the specified key. |
double |
getLength()
Returns the sum of all values in this property map, considered as double values. |
long |
getLong(java.lang.Object key)
Returns the long value of the specified key. |
double |
getMaxDouble()
Returns the maximum double value in this property map. |
java.lang.Object |
getMaxKey()
Returns the key with the maximum double value. |
double |
getMinDouble()
Returns the minimum double value in this property map. |
java.lang.String |
getString(java.lang.Object key)
Returns the String value of the specified key. |
java.lang.String |
getString(java.lang.Object key,
PropertyMap map)
Returns the String value of the specified key, using another map from where values can be taken while converting. |
double |
getSum()
Returns the sum of all values in this property map, considered as double values. |
boolean |
hasMultipleValues()
Deprecated. Use isMultipleValues() instead |
void |
inc(java.lang.Object key)
Increments the value (considered as an integer) corresponding to the specified key by one. |
void |
initDouble(java.util.Collection keys,
double init)
Inits the property map by setting the value of every key in the specified collection to the specified initial double value. |
boolean |
isMultipleValues()
Tests if multiple values for the same key are allowed. |
void |
multDouble(double d)
Multiplies the specified number with each value (considered as a double). |
void |
multDouble(java.lang.Object key,
double d)
Multiplies the specified number with the value (as a double) for the specified key. |
void |
multDouble(PropertyMap map)
Multiplies each value (as a double) in the specified map with the corresponding value in this map, for each key occurring in the specified map. |
void |
multDouble(PropertyMap map,
boolean b)
Multiplies each value (as a double) in the specified map with the corresponding value in this map, for each key occurring in the specified map. |
void |
multInt(int i)
Multiplies the specified number with each value (considered as an integer). |
void |
multInt(java.lang.Object key,
int i)
Multiplies the specified number with the value (as an integer) for the specified key. |
void |
multInt(PropertyMap map)
Multiplies each value (as an integer) in the specified map with the corresponding value in this map, for each key occurring in the specified map. |
void |
normalizeLength()
Normalises the length of this property map, i.e. that afterwards the sum of all values in this property map is one. |
abstract void |
remove(java.lang.Object key,
java.lang.Object value)
Removes the specified value for the specified key. |
void |
removeCloseToZero()
Removes all entries where the value is close to zero (considered as a double). |
void |
removeZero()
Remove all entries where the value equals zero (considered as a double). |
void |
set(java.lang.Object key,
java.lang.String value)
Sets the string value of the specified key. |
void |
setBoolean(java.lang.Object key,
boolean value)
Sets the boolean value of the specified key. |
void |
setDouble(java.lang.Object key,
double value)
Sets the double value of the specified key. |
void |
setInt(java.lang.Object key,
int value)
Sets the int value of the specified key. |
void |
setLong(java.lang.Object key,
long value)
Sets the long value of the specified key. |
void |
setMultipleValues(boolean multipleValues)
Sets whether multiple values for the same key are allowed. |
void |
setString(java.lang.Object key,
java.lang.String value)
Sets the String value of the specified key. |
void |
subDouble(double d)
Subtracts the specified number from each value (considered as a double). |
void |
subDouble(java.lang.Object key,
double d)
Subtracts the specified number from the value (as a double) for the specified key. |
void |
subDouble(PropertyMap map)
Subtracts each value (as a double) in the specified map from the corresponding value in this map, for each key occurring in the specified map. |
void |
subInt(int i)
Subtracts the specified number from each value (considered as an integer). |
void |
subInt(java.lang.Object key,
int i)
Subtracts the specified number from the value (as an integer) for the specified key. |
void |
subInt(PropertyMap map)
Subtracts each value (as an integer) in the specified map from the corresponding value in this map, for each key occurring in the specified map. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Field Detail |
protected boolean multipleValues
| Constructor Detail |
public PropertyMap()
public PropertyMap(boolean multipleValues)
multipleValues - values if true, multiple values can be hold for a key| Method Detail |
public boolean isMultipleValues()
public void setMultipleValues(boolean multipleValues)
multipleValues - if true, multiple values for the same key are allowedpublic boolean hasMultipleValues()
isMultipleValues() instead
public void set(java.lang.Object key,
java.lang.String value)
key - property keyvalue - string value of the specified keypublic abstract java.util.List getAll(java.lang.Object key)
key - property key
public abstract void remove(java.lang.Object key,
java.lang.Object value)
key - property keyvalue - value to be removedpublic java.lang.String getString(java.lang.Object key)
key - property key
public java.lang.String getString(java.lang.Object key,
PropertyMap map)
key - property keymap - another map from where values can be taken while converting
public java.lang.String convertString(java.lang.Object value,
PropertyMap map)
value - valuemap - another map from where values can be taken while converting
public void setString(java.lang.Object key,
java.lang.String value)
key - property keyvalue - String value of the specified keypublic long getLong(java.lang.Object key)
key - property key
public void setLong(java.lang.Object key,
long value)
key - property keyvalue - long value of the specified keypublic int getInt(java.lang.Object key)
key - property key
public void setInt(java.lang.Object key,
int value)
key - property keyvalue - int value of the specified keypublic double getDouble(java.lang.Object key)
key - property key
public void setDouble(java.lang.Object key,
double value)
key - property keyvalue - double value of the specified keypublic boolean getBoolean(java.lang.Object key)
key - property key
public void setBoolean(java.lang.Object key,
boolean value)
key - property keyvalue - boolean value of the specified keypublic java.lang.Object getMaxKey()
public double getSum()
public double getLength()
public void normalizeLength()
public void removeCloseToZero()
public void removeZero()
public void apply(Function func)
func - function to be appliedpublic double getMaxDouble()
public double getMinDouble()
public void initDouble(java.util.Collection keys,
double init)
keys - keys for initialisationinit - initial double valuepublic void divInt(int i)
i - numberpublic void subInt(int i)
i - numberpublic void multInt(int i)
i - numberpublic void addInt(int i)
i - numberpublic void divDouble(double d)
d - numberpublic void subDouble(double d)
d - numberpublic void multDouble(double d)
d - numberpublic void addDouble(double d)
d - numberpublic void divInt(PropertyMap map)
map - property map as operandpublic void subInt(PropertyMap map)
map - property map as operandpublic void multInt(PropertyMap map)
map - property map as operandpublic void addInt(PropertyMap map)
map - property map as operandpublic void divDouble(PropertyMap map)
map - property map as operandpublic void subDouble(PropertyMap map)
map - property map as operandpublic void multDouble(PropertyMap map)
map - property map as operand
public void multDouble(PropertyMap map,
boolean b)
map - property map as operand Multiplies every value (considered as
a double) with the specifiedb - if true, sets the value to one if no entries exists so farpublic void addDouble(PropertyMap map)
map - property map as operandpublic void inc(java.lang.Object key)
key - key
public void divInt(java.lang.Object key,
int i)
key - keyi - number
public void subInt(java.lang.Object key,
int i)
key - keyi - number
public void multInt(java.lang.Object key,
int i)
key - keyi - number
public void addInt(java.lang.Object key,
int i)
key - keyi - number
public void divDouble(java.lang.Object key,
double d)
key - keyd - number
public void subDouble(java.lang.Object key,
double d)
key - keyd - number
public void multDouble(java.lang.Object key,
double d)
key - keyd - number
public void addDouble(java.lang.Object key,
double d)
key - keyd - number
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||