Changeset 30532 in osm for applications/editors/josm/plugins/imagerycache/src/org/mapdb/Bind.java
- Timestamp:
- 2014-07-14T04:18:06+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagerycache/src/org/mapdb/Bind.java
r29363 r30532 4 4 import java.util.Map; 5 5 import java.util.NavigableSet; 6 import java.util.Set;7 6 import java.util.concurrent.ConcurrentMap; 8 7 … … 21 20 public Iterator<K1> iterator() { 22 21 //use range query to get all values 22 @SuppressWarnings("unchecked") 23 23 final Iterator<Fun.Tuple2<K2,K1>> iter = 24 ((NavigableSet)secondaryKeys) //cast is workaround for generics24 secondaryKeys 25 25 .subSet( 26 Fun.t2(secondaryKey, null), //NULL represents lower bound, everything is larger than null27 Fun.t2(secondaryKey, Fun.HI) // HI is upper bound everything is smaller then HI26 Fun.t2(secondaryKey,(K1)null), //NULL represents lower bound, everything is larger than null 27 Fun.t2(secondaryKey,(K1)Fun.HI) // HI is upper bound everything is smaller then HI 28 28 ).iterator(); 29 29 … … 59 59 } 60 60 61 public static void size(MapWithModificationListenermap, final Atomic.Long size){61 public static <K,V> void size(MapWithModificationListener<K, V> map, final Atomic.Long size){ 62 62 //set initial value first if necessary 63 63 if(size.get() == 0 && map.isEmpty()) 64 64 size.set(map.size()); //TODO long overflow? 65 65 66 map.addModificationListener(new MapListener () {66 map.addModificationListener(new MapListener<K, V>() { 67 67 @Override 68 68 public void update(Object key, Object oldVal, Object newVal) {
Note:
See TracChangeset
for help on using the changeset viewer.