I have a set of flags which are part of a huge text data file as single characters. Before processing the file I map each flag to the id of a property it represents. While processing the file I need to look up these mappings as fast as possible (I do it a lot).
Currently I store these in a HashMap. And the code looks like this:
private HashMap<Integer, Integer> _propertyKeys;
private int _getKeyedProperty(char key) {
return (_propertyKeys.get((int) key));
}
Is there any way I could be doing this faster, using a better implementation of Map than HashMap or even using arrays to prevent boxing/unboxing?