summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java')
-rw-r--r--app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java b/app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java
index dc5f705b..074e122c 100644
--- a/app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java
+++ b/app/src/main/java/com/wireguard/android/databinding/ObservableTreeMap.java
@@ -12,16 +12,10 @@ import java.util.TreeMap;
* views. This behavior is in line with that of ObservableArrayMap.
*/
-public class ObservableTreeMap<K, V> extends TreeMap<K, V> implements ObservableSortedMap<K, V> {
+public class ObservableTreeMap<K, V> extends TreeMap<K, V> implements ObservableNavigableMap<K, V> {
private transient MapChangeRegistry listeners;
@Override
- public void clear() {
- super.clear();
- notifyChange(null);
- }
-
- @Override
public void addOnMapChangedCallback(
final OnMapChangedCallback<? extends ObservableMap<K, V>, K, V> listener) {
if (listeners == null)
@@ -29,6 +23,12 @@ public class ObservableTreeMap<K, V> extends TreeMap<K, V> implements Observable
listeners.add(listener);
}
+ @Override
+ public void clear() {
+ super.clear();
+ notifyChange(null);
+ }
+
private void notifyChange(final K key) {
if (listeners != null)
listeners.notifyChange(this, key);
@@ -51,8 +51,7 @@ public class ObservableTreeMap<K, V> extends TreeMap<K, V> implements Observable
@Override
public V remove(final Object key) {
final V oldValue = super.remove(key);
- @SuppressWarnings("unchecked")
- final K k = (K) key;
+ @SuppressWarnings("unchecked") final K k = (K) key;
notifyChange(k);
return oldValue;
}