Methods Summary |
---|
public static android.filterfw.core.KeyValueMap | fromKeyValues(java.lang.Object keyValues)
KeyValueMap result = new KeyValueMap();
result.setKeyValues(keyValues);
return result;
|
public float | getFloat(java.lang.String key)
Object result = get(key);
return result != null ? (Float)result : null;
|
public int | getInt(java.lang.String key)
Object result = get(key);
return result != null ? (Integer)result : null;
|
public java.lang.String | getString(java.lang.String key)
Object result = get(key);
return result != null ? (String)result : null;
|
public void | setKeyValues(java.lang.Object keyValues)
if (keyValues.length % 2 != 0) {
throw new RuntimeException("Key-Value arguments passed into setKeyValues must be "
+ "an alternating list of keys and values!");
}
for (int i = 0; i < keyValues.length; i += 2) {
if (!(keyValues[i] instanceof String)) {
throw new RuntimeException("Key-value argument " + i + " must be a key of type "
+ "String, but found an object of type " + keyValues[i].getClass() + "!");
}
String key = (String)keyValues[i];
Object value = keyValues[i+1];
put(key, value);
}
|
public java.lang.String | toString()
StringWriter writer = new StringWriter();
for (Map.Entry<String, Object> entry : entrySet()) {
String valueString;
Object value = entry.getValue();
if (value instanceof String) {
valueString = "\"" + value + "\"";
} else {
valueString = value.toString();
}
writer.write(entry.getKey() + " = " + valueString + ";\n");
}
return writer.toString();
|