-package jalview.util.matcher;
+package jalview.datamodel.features;
+
+import jalview.datamodel.SequenceFeature;
import java.util.ArrayList;
import java.util.List;
-import java.util.function.Function;
-public class KeyedMatcherSet implements KeyedMatcherSetI
+public class FeatureMatcherSet implements FeatureMatcherSetI
{
- List<KeyedMatcherI> matchConditions;
+ List<FeatureMatcherI> matchConditions;
boolean andConditions;
/**
* Constructor
*/
- public KeyedMatcherSet()
+ public FeatureMatcherSet()
{
matchConditions = new ArrayList<>();
}
@Override
- public boolean matches(Function<String[], String> valueProvider)
+ public boolean matches(SequenceFeature feature)
{
/*
* no conditions matches anything
*/
if (andConditions)
{
- for (KeyedMatcherI m : matchConditions)
+ for (FeatureMatcherI m : matchConditions)
{
- if (!m.matches(valueProvider))
+ if (!m.matches(feature))
{
return false;
}
/*
* OR until match
*/
- for (KeyedMatcherI m : matchConditions)
+ for (FeatureMatcherI m : matchConditions)
{
- if (m.matches(valueProvider))
+ if (m.matches(feature))
{
return true;
}
}
@Override
- public KeyedMatcherSetI and(KeyedMatcherI m)
+ public FeatureMatcherSetI and(FeatureMatcherI m)
{
if (!andConditions && matchConditions.size() > 1)
{
}
@Override
- public KeyedMatcherSetI or(KeyedMatcherI m)
+ public FeatureMatcherSetI or(FeatureMatcherI m)
{
if (andConditions && matchConditions.size() > 1)
{
}
@Override
- public Iterable<KeyedMatcherI> getMatchers()
+ public Iterable<FeatureMatcherI> getMatchers()
{
return matchConditions;
}
{
StringBuilder sb = new StringBuilder();
boolean first = true;
- for (KeyedMatcherI matcher : matchConditions)
+ for (FeatureMatcherI matcher : matchConditions)
{
if (!first)
{