A couple of ways to do this:
1. Use a Hashtable with key as the static int Color map and the value as the String representation of that colour.
2. Use 2 arrays; a 'int' array as the Color values and a 'String' array as the string description. The int and String arrays are mapped directly (i.e. 1 to 1).
ASIDE: Interesting that RIM being a canadian company decided to call the class Color rather than Colour (Canadian Spelling).
|