Changeset 1709 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-06-28T11:37:21+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/history
- Files:
-
- 2 edited
-
HistoryDataSet.java (modified) (2 diffs)
-
HistoryOsmPrimitive.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java
r1670 r1709 9 9 10 10 public class HistoryDataSet { 11 12 private static HistoryDataSet historyDataSet; 13 14 public static HistoryDataSet getInstance() { 15 if (historyDataSet == null) { 16 historyDataSet = new HistoryDataSet(); 17 } 18 return historyDataSet; 19 } 11 20 12 21 private HashMap<Long, ArrayList<HistoryOsmPrimitive>> data; … … 44 53 ArrayList<HistoryOsmPrimitive> versions = data.get(id); 45 54 if (versions == null) 46 throw new NoSuchElementException(tr("Didn't find an historized primitive with id {0} in this dataset", id));55 return null; 47 56 return new History(id, versions); 48 57 } 58 59 /** 60 * merges the histories from the {@see HistoryDataSet} other in this history data set 61 * 62 * @param other the other history data set. Ignored if null. 63 */ 64 public void mergeInto(HistoryDataSet other) { 65 if (other == null) 66 return; 67 for (Long id : other.data.keySet()) { 68 if (!this.data.keySet().contains(id)) { 69 this.data.put(id, other.data.get(id)); 70 } 71 } 72 } 49 73 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r1670 r1709 2 2 package org.openstreetmap.josm.data.osm.history; 3 3 4 import java.util.Collections; 4 5 import java.util.Date; 5 6 import java.util.HashMap; 7 import java.util.Map; 6 8 7 9 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 116 118 } 117 119 120 public Map<String,String> getTags() { 121 return Collections.unmodifiableMap(tags); 122 } 123 118 124 @Override 119 125 public int hashCode() {
Note:
See TracChangeset
for help on using the changeset viewer.
