Name: jl125535 Date: 06/18/2003
A DESCRIPTION OF THE REQUEST :
Preferences API do not have means to store or retrieve String, int and other types of arrays. Since storing arrays are one of the most frequently used features, it would be of great benefit if Preferences API had support for this.
Example:
Preferences prefs = Preferences.systemRoot();
prefs.putArray("possibleColors", new String[]{"red", "yellow", "green", "blue", "black"});
String[] colors = prefs.getArray("possibleColors");
prefs.putIntArray("possibleValues", new int[]{0, 1, 2});
int[] values = prefs.getIntArray("possibleValues");
JUSTIFICATION :
Since storing and retrieval of arrays are one of the most frequently used features, it would be of great benefit if Preferences API had support for this.
CUSTOMER SUBMITTED WORKAROUND :
At present, you can work around this feature as storing a comma separated value and parsing upon retrieval.
Example:
Preferences prefs = Preferences.systemRoot();
prefs.put("possibleColors", "red, yellow, green, blue, black");
String colorsList = prefs.get("possibleColors");
String[] colors = parseCommas(colorList);
(Review ID: 182638)
======================================================================
###@###.### 11/3/04 20:41 GMT
A DESCRIPTION OF THE REQUEST :
Preferences API do not have means to store or retrieve String, int and other types of arrays. Since storing arrays are one of the most frequently used features, it would be of great benefit if Preferences API had support for this.
Example:
Preferences prefs = Preferences.systemRoot();
prefs.putArray("possibleColors", new String[]{"red", "yellow", "green", "blue", "black"});
String[] colors = prefs.getArray("possibleColors");
prefs.putIntArray("possibleValues", new int[]{0, 1, 2});
int[] values = prefs.getIntArray("possibleValues");
JUSTIFICATION :
Since storing and retrieval of arrays are one of the most frequently used features, it would be of great benefit if Preferences API had support for this.
CUSTOMER SUBMITTED WORKAROUND :
At present, you can work around this feature as storing a comma separated value and parsing upon retrieval.
Example:
Preferences prefs = Preferences.systemRoot();
prefs.put("possibleColors", "red, yellow, green, blue, black");
String colorsList = prefs.get("possibleColors");
String[] colors = parseCommas(colorList);
(Review ID: 182638)
======================================================================
###@###.### 11/3/04 20:41 GMT