package jalview.datamodel.features; import jalview.datamodel.SequenceFeature; /** * An interface to describe a set of one or more feature matchers, where all * matchers are combined with either AND or OR * * @author gmcarstairs * */ public interface FeatureMatcherSetI { /** * Answers true if the feature provided passes this matcher's match condition * * @param feature * @return */ boolean matches(SequenceFeature feature); /** * Answers a new object that matches the logical AND of this and m * * @param m * @return * @throws IllegalStateException * if an attempt is made to AND to existing OR-ed conditions */ FeatureMatcherSetI and(FeatureMatcherI m); /** * Answers true if any second condition is AND-ed with this one, false if it * is OR-ed * * @return */ boolean isAnded(); /** * Answers a new object that matches the logical OR of this and m * * @param m * @return * @throws IllegalStateException * if an attempt is made to OR to existing AND-ed conditions */ FeatureMatcherSetI or(FeatureMatcherI m); /** * Answers an iterator over the combined match conditions * * @return */ Iterable getMatchers(); /** * Answers true if this object contains no conditions * * @return */ boolean isEmpty(); }