getInt method
Gets a property's value as an int value.
Floating point values will be rounded. The value true
is returned as 1, false
as 0.
Returns 0 if the property doesn't exist or does not have a numeric value.
- Parameter key: The key.
- Returns: The Int value.
Implementation
int getInt(String key) {
Object _result = getValue(key);
if (_result is double) {
return _result.toInt();
} else if (_result is int) {
return _result;
} else {
return 0;
}
}