Changeset 367 in josm for trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
- Timestamp:
- 2007-10-12T01:28:49+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r362 r367 5 5 import java.text.SimpleDateFormat; 6 6 import java.util.ArrayList; 7 import java.util.Arrays; 7 8 import java.util.Collection; 8 9 import java.util.Collections; 9 10 import java.util.Date; 10 11 import java.util.HashMap; 12 import java.util.HashSet; 11 13 import java.util.Map; 12 14 import java.util.Map.Entry; … … 81 83 82 84 /** 85 * true if this object is considered "tagged". To be "tagged", an object 86 * must have one or more "non-standard" tags. "created_by" and "source" 87 * are typically considered "standard" tags and do not make an object 88 * "tagged". 89 */ 90 public boolean tagged = false; 91 92 /** 83 93 * If set to true, this object is currently selected. 84 94 */ … … 104 114 public boolean incomplete = false; 105 115 116 /** 117 * Contains a list of "uninteresting" keys that do not make an object 118 * "tagged". 119 */ 120 public static Collection<String> uninteresting = 121 new HashSet<String>(Arrays.asList(new String[] {"source", "note", "created_by"})); 122 106 123 /** 107 124 * Implementation of the visitor scheme. Subclases have to call the correct … … 176 193 keys.put(key, value); 177 194 } 195 checkTagged(); 178 196 } 179 197 /** … … 186 204 keys = null; 187 205 } 206 checkTagged(); 188 207 } 189 208 … … 215 234 selected = osm.selected; 216 235 timestamp = osm.timestamp; 236 tagged = osm.tagged; 217 237 } 218 238 … … 237 257 } 238 258 259 /** 260 * Updates the "tagged" flag. "keys" property should probably be made private 261 * to make sure this gets called when keys are set. 262 */ 263 public void checkTagged() { 264 tagged = false; 265 if (keys != null) { 266 for (Entry<String,String> e : keys.entrySet()) { 267 if (!uninteresting.contains(e.getKey())) { 268 tagged = true; 269 break; 270 } 271 } 272 } 273 } 239 274 240 275 }
Note:
See TracChangeset
for help on using the changeset viewer.