aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rwxr-xr-xapp/src/main/java/org/rssin/rssin/Filter.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/src/main/java/org/rssin/rssin/Filter.java b/app/src/main/java/org/rssin/rssin/Filter.java
index c135586..2e1188e 100755
--- a/app/src/main/java/org/rssin/rssin/Filter.java
+++ b/app/src/main/java/org/rssin/rssin/Filter.java
@@ -1,6 +1,7 @@
package org.rssin.rssin;
import android.text.TextUtils;
+import android.util.Log;
import org.rssin.neurons.FeedSorter;
import org.rssin.storage.Storable;
@@ -83,6 +84,12 @@ public class Filter implements Storable {
return feedSorter;
}
+ /**
+ * Ensure that there is a feedSorter linked to this object
+ * Because the feedSorter attribute is transient (if not, serialization for changing settings takes too long),
+ * we need to manually ensure we get the FeedSorter as well every time we need it.
+ * @param storageProvider
+ */
public synchronized void ensureFeedSorter(StorageProvider storageProvider) {
if (storageKey == null) {
storageKey = storageProvider.uniqueKey();
@@ -109,6 +116,11 @@ public class Filter implements Storable {
return sb.toString().hashCode();
}
+ /**
+ * Save the Filter
+ * @param storageProvider
+ * @throws Exception
+ */
public synchronized void store(StorageProvider storageProvider) throws Exception {
if (storageKey == null) {
storageKey = storageProvider.uniqueKey();
@@ -116,6 +128,11 @@ public class Filter implements Storable {
storageProvider.store(storageKey, this);
}
+ /**
+ * Save the FeedSorter of this Filter
+ * @param storageProvider
+ * @throws Exception
+ */
public synchronized void storeFeedSorter(StorageProvider storageProvider) throws Exception {
ensureFeedSorter(storageProvider);
storageProvider.store(storageKey, feedSorter);