Changeset 2932 in josm for trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
- Timestamp:
- 03.02.2010 22:53:24 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2906 r2932 223 223 } 224 224 225 protected OsmPrimitive(PrimitiveData data) { 226 version = data.getVersion(); 227 id = data.getId(); 225 /** 226 * Creates a new primitive for the given id and version. 227 * 228 * If allowNegativeId is set, provided id can be < 0 and will be set to primitive without any processing. 229 * If allowNegativeId is not set, then id will have to be 0 (in that case new unique id will be generated) or 230 * positive number. 231 * 232 * If id is not > 0 version is ignored and set to 0. 233 * 234 * @param id 235 * @param version 236 * @param allowNegativeId 237 * @throws IllegalArgumentException thrown if id < 0 and allowNegativeId is false 238 */ 239 protected OsmPrimitive(long id, int version, boolean allowNegativeId) throws IllegalArgumentException { 240 this(id, allowNegativeId); 241 this.version = (id > 0 ? version : 0); 228 242 } 229 243 … … 1161 1175 public void load(PrimitiveData data) { 1162 1176 setKeys(data.getKeys()); 1163 timestamp = data.getTimestamp();1177 setTimestamp(data.getTimestamp()); 1164 1178 user = data.getUser(); 1165 1179 setChangesetId(data.getChangesetId()); … … 1180 1194 data.getKeys().clear(); 1181 1195 data.getKeys().putAll(getKeys()); 1182 data.setTimestamp( timestamp);1196 data.setTimestamp(getTimestamp()); 1183 1197 data.setUser(user); 1184 1198 data.setDeleted(isDeleted());
Note: See TracChangeset
for help on using the changeset viewer.
