persistable sclass SynchronizedNavigableMap extends SynchronizedSortedMap is NavigableMap { NavigableMap innerMap() { ret (NavigableMap) m; } SynchronizedNavigableMap(NavigableMap m) { super(m); } SynchronizedNavigableMap(NavigableMap m, Object mutex) { super(m, mutex); } public Entry lowerEntry(K key) { synchronized (mutex) { return innerMap().lowerEntry(key); } } public K lowerKey(K key) { synchronized (mutex) { return innerMap().lowerKey(key); } } public Entry floorEntry(K key) { synchronized (mutex) { return innerMap().floorEntry(key); } } public K floorKey(K key) { synchronized (mutex) { return innerMap().floorKey(key); } } public Entry ceilingEntry(K key) { synchronized (mutex) { return innerMap().ceilingEntry(key); } } public K ceilingKey(K key) { synchronized (mutex) { return innerMap().ceilingKey(key); } } public Entry higherEntry(K key) { synchronized (mutex) { return innerMap().higherEntry(key); } } public K higherKey(K key) { synchronized (mutex) { return innerMap().higherKey(key); } } public Entry firstEntry() { synchronized (mutex) { return innerMap().firstEntry(); } } public Entry lastEntry() { synchronized (mutex) { return innerMap().lastEntry(); } } public Entry pollFirstEntry() { synchronized (mutex) { return innerMap().pollFirstEntry(); } } public Entry pollLastEntry() { synchronized (mutex) { return innerMap().pollLastEntry(); } } public NavigableMap descendingMap() { synchronized (mutex) { return new SynchronizedNavigableMap<>(innerMap().descendingMap(), mutex); } } public NavigableSet keySet() { return navigableKeySet(); } public NavigableSet navigableKeySet() { synchronized (mutex) { return new SynchronizedNavigableSet<>(innerMap().navigableKeySet(), mutex); } } public NavigableSet descendingKeySet() { synchronized (mutex) { return new SynchronizedNavigableSet<>(innerMap().descendingKeySet(), mutex); } } public SortedMap subMap(K fromKey, K toKey) { synchronized (mutex) { return new SynchronizedNavigableMap<>( innerMap().subMap(fromKey, true, toKey, false), mutex); } } public SortedMap headMap(K toKey) { synchronized (mutex) { return new SynchronizedNavigableMap<>(innerMap().headMap(toKey, false), mutex); } } public SortedMap tailMap(K fromKey) { synchronized (mutex) { return new SynchronizedNavigableMap<>(innerMap().tailMap(fromKey, true),mutex); } } public NavigableMap subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) { synchronized (mutex) { return new SynchronizedNavigableMap<>( innerMap().subMap(fromKey, fromInclusive, toKey, toInclusive), mutex); } } public NavigableMap headMap(K toKey, boolean inclusive) { synchronized (mutex) { return new SynchronizedNavigableMap<>( innerMap().headMap(toKey, inclusive), mutex); } } public NavigableMap tailMap(K fromKey, boolean inclusive) { synchronized (mutex) { return new SynchronizedNavigableMap<>( innerMap().tailMap(fromKey, inclusive), mutex); } } }