Changeset 5136 in josm
- Timestamp:
- 2012-03-30T16:42:27+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5050 r5136 1070 1070 } 1071 1071 1072 / **1073 * Called from the XML parser to set the types this preset affects1074 */1072 // cache the parsing of types using a LRU cache (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html) 1073 private static final Map<String,EnumSet<PresetType>> typeCache = 1074 new LinkedHashMap<String, EnumSet<PresetType>>(16, 1.1f, true); 1075 1075 1076 1076 static public EnumSet<PresetType> getType(String types) throws SAXException { 1077 if (typeCache.containsKey(types)) { 1078 return typeCache.get(types); 1079 } 1077 1080 EnumSet<PresetType> result = EnumSet.noneOf(PresetType.class); 1078 1081 for (String type : Arrays.asList(types.split(","))) { … … 1084 1087 } 1085 1088 } 1089 typeCache.put(types, result); 1086 1090 return result; 1087 1091 } 1088 1092 1093 /* 1094 * Called from the XML parser to set the types this preset affects. 1095 */ 1089 1096 public void setType(String types) throws SAXException { 1090 1097 this.types = getType(types);
Note:
See TracChangeset
for help on using the changeset viewer.