Changeset 13924 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-06-12T22:19:16+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r13913 r13924 199 199 200 200 /** 201 * Replies the unique primitive id for this primitive 201 * Replies the OSM id of this primitive. 202 * By default, returns the same value as {@link #getId}. 203 * Can be overidden by primitive implementations handling an internal id different from the OSM one. 204 * 205 * @return the OSM id of this primitive. 206 * @since 13924 207 */ 208 default long getOsmId() { 209 return getId(); 210 } 211 212 /** 213 * Replies the OSM primitive id for this primitive. 214 * 215 * @return the OSM primitive id for this primitive 216 * @see #getOsmId 217 * @since 13924 218 */ 219 default PrimitiveId getOsmPrimitiveId() { 220 return new SimplePrimitiveId(getOsmId(), getType()); 221 } 222 223 /** 224 * Replies the unique primitive id for this primitive. 202 225 * 203 226 * @return the unique primitive id for this primitive 227 * @see #getUniqueId 204 228 */ 205 229 default PrimitiveId getPrimitiveId() { -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveId.java
r8419 r13924 3 3 4 4 /** 5 * interface to represent identif action and type of the datatypes primitives.5 * interface to represent identification and type of the datatypes primitives. 6 6 * 7 7 * @since 2399 -
trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
r13849 r13924 113 113 * Adds an object to be loaded, the object is specified by an OSM primitive. 114 114 * 115 * @param primitive the OSM primitive. Must not be null. primitive.get Id() > 0 required.115 * @param primitive the OSM primitive. Must not be null. primitive.getOsmId() > 0 required. 116 116 * @return this task 117 117 * @throws IllegalArgumentException if the primitive is null 118 * @throws IllegalArgumentException if primitive.get Id() <= 0118 * @throws IllegalArgumentException if primitive.getOsmId() <= 0 119 119 */ 120 120 public HistoryLoadTask add(OsmPrimitive primitive) { 121 CheckParameterUtil.ensure(primitive, "primitive", "id > 0", prim -> prim.get UniqueId() > 0);122 return add(primitive.get PrimitiveId());121 CheckParameterUtil.ensure(primitive, "primitive", "id > 0", prim -> prim.getOsmId() > 0); 122 return add(primitive.getOsmPrimitiveId()); 123 123 } 124 124
Note:
See TracChangeset
for help on using the changeset viewer.