Currently I'm implementing a Persistant Storage Object for my Blackberry Application.
It contains a Vector of Setting Objects.
My current implemention to get specific settings value looks like this
public String getSettingByName(String key)
{
String value = "";
for ( Enumeration e = _appSettings.elements(); e.hasMoreElements();)
{
if(((AppSettingsObject)e.nextElement()).get_key() == key)
{
value = ((AppSettingsObject)e.nextElement()).get_value();
}
}
return value;
}
Is there a better way to access that value than looping the enumeration?
Thanks!