|
|
|
|
@ -45,7 +45,7 @@ fun List<Comparator>.combined(): List<List<QueryCondition>> { |
|
|
|
|
this.forEach { |
|
|
|
|
comparatorList.add(it.queryConditions) |
|
|
|
|
} |
|
|
|
|
return getCombinations(comparatorList) |
|
|
|
|
return getCombinations(comparatorList) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline fun <reified T : Filterable> List<QueryCondition>.query(realm: Realm): RealmQuery<T> { |
|
|
|
|
@ -57,7 +57,7 @@ inline fun <reified T : Filterable> List<QueryCondition>.query(realm: Realm): Re |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun <T> getCombinations(lists: List<List<T>>): List<List<T>> { |
|
|
|
|
var combinations: MutableSet<List<T>> = HashSet() |
|
|
|
|
var combinations: MutableSet<List<T>> = LinkedHashSet() |
|
|
|
|
var newCombinations: MutableSet<List<T>> |
|
|
|
|
|
|
|
|
|
var index = 0 |
|
|
|
|
@ -69,10 +69,10 @@ fun <T> getCombinations(lists: List<List<T>>): List<List<T>> { |
|
|
|
|
newList.add(i) |
|
|
|
|
combinations.add(newList) |
|
|
|
|
} |
|
|
|
|
index++ |
|
|
|
|
index++ |
|
|
|
|
while (index < lists.size) { |
|
|
|
|
val nextList = lists[index] |
|
|
|
|
newCombinations = HashSet() |
|
|
|
|
newCombinations = LinkedHashSet() |
|
|
|
|
for (first in combinations) { |
|
|
|
|
for (second in nextList) { |
|
|
|
|
val newList = ArrayList<T>() |
|
|
|
|
|