Changeset 2242 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-10-04T00:37:05+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/history
- Files:
-
- 3 edited
-
History.java (modified) (2 diffs)
-
HistoryNode.java (modified) (3 diffs)
-
HistoryOsmPrimitive.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r2181 r2242 10 10 import java.util.List; 11 11 import java.util.NoSuchElementException; 12 13 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 12 14 13 15 public class History{ … … 195 197 return versions.isEmpty(); 196 198 } 199 200 public OsmPrimitiveType getType() { 201 if (isEmpty()) 202 throw new NoSuchElementException(tr("No type found. History is empty.")); 203 return versions.get(0).getType(); 204 } 197 205 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java
r1670 r2242 5 5 6 6 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 7 import org.openstreetmap.josm.data.coor.LatLon; 7 8 8 9 … … 13 14 */ 14 15 public class HistoryNode extends HistoryOsmPrimitive { 15 public HistoryNode(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp) { 16 private LatLon coor; 17 public HistoryNode(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp, 18 double lat, double lon) { 16 19 super(id, version, visible, user, uid, changesetId, timestamp); 20 coor = new LatLon(lat, lon); 17 21 } 18 22 … … 21 25 return OsmPrimitiveType.NODE; 22 26 } 27 28 public LatLon getCoordinate() { 29 return coor; 30 } 23 31 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r2181 r2242 39 39 /** 40 40 * constructor 41 * 41 * 42 42 * @param id the id (>0 required) 43 43 * @param version the version (> 0 required) … … 47 47 * @param changesetId the changeset id (> 0 required) 48 48 * @param timestamp the timestamp (! null required) 49 * 49 * 50 50 * @throws IllegalArgumentException thrown if preconditions are violated 51 51 */ … … 53 53 ensurePositiveLong(id, "id"); 54 54 ensurePositiveLong(version, "version"); 55 ensurePositiveLong(uid, "uid"); 55 if(uid != -1) /* allow -1 for anonymous users */ 56 ensurePositiveLong(uid, "uid"); 56 57 ensurePositiveLong(changesetId, "changesetId"); 57 58 ensureNotNull(user, "user");
Note:
See TracChangeset
for help on using the changeset viewer.
