Changeset 2906 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2010-01-29T22:26:58+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2903 r2906 47 47 } 48 48 49 private static class KeysEntry implements Entry<String, String>{50 51 private final String key;52 private final String value;53 54 private KeysEntry(String key, String value) {55 this.key = key;56 this.value = value;57 }58 59 public String getKey() {60 return key;61 }62 63 public String getValue() {64 return value;65 }66 67 public String setValue(String value) {68 throw new UnsupportedOperationException();69 }70 71 @Override72 public int hashCode() {73 final int prime = 31;74 int result = 1;75 result = prime * result + ((key == null) ? 0 : key.hashCode());76 result = prime * result + ((value == null) ? 0 : value.hashCode());77 return result;78 }79 80 @Override81 public boolean equals(Object obj) {82 if (this == obj)83 return true;84 if (obj == null)85 return false;86 if (getClass() != obj.getClass())87 return false;88 KeysEntry other = (KeysEntry) obj;89 if (key == null) {90 if (other.key != null)91 return false;92 } else if (!key.equals(other.key))93 return false;94 if (value == null) {95 if (other.value != null)96 return false;97 } else if (!value.equals(other.value))98 return false;99 return true;100 }101 }102 103 49 private static final int FLAG_MODIFIED = 1 << 0; 104 50 private static final int FLAG_VISIBLE = 1 << 1; … … 556 502 // FIXME: incline=\"-*\" search pattern does not work. 557 503 String reversedDirectionDefault = "oneway=\"-1\" | incline=down | incline=\"-*\""; 558 504 559 505 String directionDefault = "oneway? | incline=* | aerialway=* | "+ 560 561 562 506 "waterway=stream | waterway=river | waterway=canal | waterway=drain | waterway=rapids | "+ 507 "\"piste:type\"=downhill | \"piste:type\"=sled | man_made=\"piste:halfpipe\" | "+ 508 "junction=roundabout"; 563 509 564 510 try { … … 846 792 } 847 793 848 // FIXME: why replying a collection of entries? Should be replaced by849 // a method Map<String,String> getTags()850 //851 public final Collection<Entry<String, String>> entrySet() {852 if (keys == null || keys.length ==0)853 return Collections.emptySet();854 Set<Entry<String, String>> result = new HashSet<Entry<String,String>>();855 for (int i=0; i<keys.length; i+=2) {856 result.add(new KeysEntry(keys[i], keys[i+1]));857 }858 return result;859 }860 861 794 public final Collection<String> keySet() { 862 795 if (keys == null || keys.length == 0) … … 910 843 */ 911 844 public boolean hasSameTags(OsmPrimitive other) { 912 return entrySet().equals(other.entrySet());845 return keySet().equals(other.keySet()); 913 846 } 914 847
Note:
See TracChangeset
for help on using the changeset viewer.