From 02d86e0064c8700ba0e3e524c77535e3d85de776 Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 1 Mar 2019 17:29:35 +0100 Subject: [PATCH] Add comments on Filter goals --- .../android/model/filter/Filterable.kt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/src/main/java/net/pokeranalytics/android/model/filter/Filterable.kt b/app/src/main/java/net/pokeranalytics/android/model/filter/Filterable.kt index b3d01ead..56875b83 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/filter/Filterable.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/filter/Filterable.kt @@ -3,6 +3,32 @@ package net.pokeranalytics.android.model.filter import io.realm.RealmObject import io.realm.RealmResults +/** + * We want to be able to store filters in the database: + * - filters can be a combination of sub filters + * - filters can be applied to different type of objects: Sessions, Hands, Transactions... + * - filters can be applied to a list of different type of objects (feed) + * + * A filter is described by the following: + * - a data type: Session, Hands... + * - a field: table size of a Session + * - an operator: equal, >=, <... + * - a value: an id, a number, a date... + * + * We can decide to have a collection of [operator, value] for a field + * + * Combination: + * - multiple datatype filters should be handled as 'OR' + * - multiple field filters should be handled as 'AND' + * - multiple '=' filters as 'OR' + * - multiple 'Greater than', 'less than' as 'AND' + * - multiple values as 'OR' + * + * Also: + * A filter should be able to be converted into a Realm query + * + */ + interface Filterable { }