I have a list
of hashmap<string, real>
. I want to access each element on the list, apply a predicate
on it and add the element to another list if the predicate returns true.
For example suppose I have a list of hashmap like this - {(a, 15), (b, 17), (c, 12)}, {(a, 12), (b, 13), (d, 90)}
. My predicate would be something like a > 7 & b < 15
. Now I would apply this predicate on each element of the list and will find that the second element satisfy the predicate.
Applying the predicate should be easy as all I have to do is to access the element and compare its value with values supplied with predicate.
The part where I am stuck is how to save such a predicate
in a configuration
file, such that it can be easily converted into a class and new predicates can be added without fiddling with core code.