/*
* Copyright © 2019 Damyan Ivanov.
- * This file is part of Mobile-Ledger.
- * Mobile-Ledger is free software: you can distribute it and/or modify it
+ * This file is part of MoLe.
+ * MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opinion), any later version.
*
- * Mobile-Ledger is distributed in the hope that it will be useful,
+ * MoLe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License terms for details.
*
* You should have received a copy of the GNU General Public License
- * along with Mobile-Ledger. If not, see <https://www.gnu.org/licenses/>.
+ * along with MoLe. If not, see <https://www.gnu.org/licenses/>.
*/
package net.ktnx.mobileledger.utils;
import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.RequiresApi;
import android.util.Log;
import java.util.Collection;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
-public class ObservableList<T> extends Observable {
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+
+public class ObservableList<T> extends Observable implements List<T> {
private List<T> list;
public ObservableList(List<T> list) {
this.list = list;
public boolean contains(@Nullable Object o) {
return list.contains(o);
}
+ @NonNull
public Iterator<T> iterator() {
return list.iterator();
}
if (result) forceNotify();
return result;
}
+ public T removeQuietly(int index) {
+ return list.remove(index);
+ }
public boolean containsAll(@NonNull Collection<?> c) {
return list.containsAll(c);
}
if (result) forceNotify();
return result;
}
+ public boolean addAllQuietly(int index, Collection<? extends T> c) {
+ return list.addAll(index, c);
+ }
public boolean removeAll(@NonNull Collection<?> c) {
boolean result = list.removeAll(c);
if (result) forceNotify();