Changeset 13420 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2018-02-12T23:19:49+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r13309 r13420 200 200 private final ConflictCollection conflicts = new ConflictCollection(); 201 201 202 private short mappaintCacheIdx = 1; 203 202 204 /** 203 205 * Constructs a new {@code DataSet}. … … 1380 1382 return null; 1381 1383 } 1384 1385 /** 1386 * Returns mappaint cache index for this DataSet. 1387 * 1388 * If the {@link OsmPrimitive#mappaintCacheIdx} is not equal to the DataSet mappaint 1389 * cache index, this means the cache for that primitive is out of date. 1390 * @return mappaint cache index 1391 * @since 13420 1392 */ 1393 public short getMappaintCacheIndex() { 1394 return mappaintCacheIdx; 1395 } 1396 1397 /** 1398 * Clear the mappaint cache for this DataSet. 1399 * @since 13420 1400 */ 1401 public void clearMappaintCache() { 1402 mappaintCacheIdx++; 1403 } 1382 1404 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r13309 r13420 204 204 205 205 /** 206 * Check if the cached style for this primitive is up to date. 207 * @return true if the cached style for this primitive is up to date 208 * @since 13420 209 */ 210 public final boolean isCachedStyleUpToDate() { 211 return mappaintStyle != null && mappaintCacheIdx == dataSet.getMappaintCacheIndex(); 212 } 213 214 /** 215 * Declare that the cached style for this primitive is up to date. 216 * @since 13420 217 */ 218 public final void declareCachedStyleUpToDate() { 219 this.mappaintCacheIdx = dataSet.getMappaintCacheIndex(); 220 } 221 222 /** 206 223 * Returns mappaint cache index. 207 224 * @return mappaint cache index 208 */ 225 * @deprecated no longer supported (see also {@link #isCachedStyleUpToDate()}) 226 */ 227 @Deprecated 209 228 public final short getMappaintCacheIdx() { 210 229 return mappaintCacheIdx; … … 214 233 * Sets the mappaint cache index. 215 234 * @param mappaintCacheIdx mappaint cache index 216 */ 235 * @deprecated no longer supported (see also {@link #declareCachedStyleUpToDate()}) 236 */ 237 @Deprecated 217 238 public final void setMappaintCacheIdx(short mappaintCacheIdx) { 218 239 this.mappaintCacheIdx = mappaintCacheIdx;
Note:
See TracChangeset
for help on using the changeset viewer.