Changeset 9980 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2016-03-13T16:31:38+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Filter.java
r9665 r9980 11 11 * 12 12 * @author Petr_Dlouhý 13 * @since 2125 13 14 */ 14 15 public class Filter extends SearchSetting { 15 16 private static final String version = "1"; 16 17 18 /** 19 * Enabled status. 20 * @see FilterPreferenceEntry#enable 21 */ 17 22 public boolean enable = true; 23 24 /** 25 * If this option is activated, the chosen objects are completely hidden. 26 * Otherwise they are disabled and shown in a shade of gray. 27 * @see FilterPreferenceEntry#hiding 28 */ 18 29 public boolean hiding; 30 31 /** 32 * Normally, the specified objects are hidden and the rest is shown. 33 * If this option is activated, only the specified objects are shown and the rest is hidden. 34 * @see FilterPreferenceEntry#inverted 35 */ 19 36 public boolean inverted; 20 37 … … 27 44 } 28 45 46 /** 47 * Constructs a new {@code Filter} from a preference entry. 48 * @param e preference entry 49 */ 29 50 public Filter(FilterPreferenceEntry e) { 30 51 this(); … … 48 69 49 70 public static class FilterPreferenceEntry { 50 @pref @writeExplicitly public String version = "1"; 71 @writeExplicitly 72 @pref public String version = "1"; 73 51 74 @pref public String text; 52 @pref @writeExplicitly public String mode = "add"; 75 76 /** 77 * Mode selector which defines how a filter is combined with the previous one:<ul> 78 * <li>replace: replace selection</li> 79 * <li>add: add to selection</li> 80 * <li>remove: remove from selection</li> 81 * <li>in_selection: find in selection</li> 82 * </ul> 83 * @see SearchMode 84 */ 85 @writeExplicitly 86 @pref public String mode = "add"; 87 53 88 @pref public boolean case_sensitive; 89 54 90 @pref public boolean regex_search; 91 55 92 @pref public boolean mapCSS_search; 56 @pref @writeExplicitly public boolean enable = true; 57 @pref @writeExplicitly public boolean hiding; 58 @pref @writeExplicitly public boolean inverted; 93 94 /** 95 * Enabled status. 96 * @see Filter#enable 97 */ 98 @writeExplicitly 99 @pref public boolean enable = true; 100 101 /** 102 * If this option is activated, the chosen objects are completely hidden. 103 * Otherwise they are disabled and shown in a shade of gray. 104 * @see Filter#hiding 105 */ 106 @writeExplicitly 107 @pref public boolean hiding; 108 109 /** 110 * Normally, the specified objects are hidden and the rest is shown. 111 * If this option is activated, only the specified objects are shown and the rest is hidden. 112 * @see Filter#inverted 113 */ 114 @writeExplicitly 115 @pref public boolean inverted; 59 116 } 60 117 118 /** 119 * Returns a new preference entry for this filter. 120 * @return preference entry 121 */ 61 122 public FilterPreferenceEntry getPreferenceEntry() { 62 123 FilterPreferenceEntry e = new FilterPreferenceEntry(); -
trunk/src/org/openstreetmap/josm/data/osm/Storage.java
r9975 r9980 144 144 this.hash = ha; 145 145 int cap = 1 << (int) (Math.ceil(Math.log(capacity/LOAD_FACTOR) / Math.log(2))); 146 @SuppressWarnings("unchecked") T[] newData = (T[]) new Object[cap]; 146 @SuppressWarnings("unchecked") 147 T[] newData = (T[]) new Object[cap]; 147 148 data = newData; 148 149 mask = data.length - 1; … … 175 176 @Override 176 177 public synchronized boolean contains(Object o) { 177 @SuppressWarnings("unchecked") T t = (T) o; 178 @SuppressWarnings("unchecked") 179 T t = (T) o; 178 180 int bucket = getBucket(hash, t); 179 181 return bucket >= 0; … … 188 190 @Override 189 191 public synchronized boolean remove(Object o) { 190 @SuppressWarnings("unchecked") T t = (T) o; 192 @SuppressWarnings("unchecked") 193 T t = (T) o; 191 194 T tOrig = removeElem(t); 192 195 return tOrig != null; … … 329 332 private void ensureSpace() { 330 333 if (size > data.length*LOAD_FACTOR) { // rehash 331 @SuppressWarnings("unchecked") T[] big = (T[]) new Object[data.length * 2]; 334 @SuppressWarnings("unchecked") 335 T[] big = (T[]) new Object[data.length * 2]; 332 336 int nMask = big.length - 1; 333 337 … … 387 391 @Override 388 392 public boolean containsKey(Object o) { 389 @SuppressWarnings("unchecked") K key = (K) o; 393 @SuppressWarnings("unchecked") 394 K key = (K) o; 390 395 int bucket = getBucket(fHash, key); 391 396 return bucket >= 0; … … 399 404 @Override 400 405 public T get(Object o) { 401 @SuppressWarnings("unchecked") K key = (K) o; 406 @SuppressWarnings("unchecked") 407 K key = (K) o; 402 408 int bucket = getBucket(fHash, key); 403 409 return bucket < 0 ? null : data[bucket]; … … 414 420 synchronized (Storage.this) { 415 421 modCount++; 416 @SuppressWarnings("unchecked") K key = (K) o; 422 @SuppressWarnings("unchecked") 423 K key = (K) o; 417 424 int bucket = getBucket(fHash, key); 418 425
Note:
See TracChangeset
for help on using the changeset viewer.