X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2Fmatcher%2FCondition.java;h=3401ae84e22986a2e4e483b3fff9430f4d72f367;hb=ef14d83cfe8ca0bb2271d50d638516cdc90c2b8b;hp=4d140633a374c941b60c0e7cf104cee9487e14cb;hpb=07108e505ff923f3b5135ffbdbb79259fe53432e;p=jalview.git diff --git a/src/jalview/util/matcher/Condition.java b/src/jalview/util/matcher/Condition.java index 4d14063..3401ae8 100644 --- a/src/jalview/util/matcher/Condition.java +++ b/src/jalview/util/matcher/Condition.java @@ -11,17 +11,21 @@ import java.util.Map; */ public enum Condition { - Contains(false), NotContains(false), Matches(false), NotMatches(false), - Present(false), NotPresent(false), - EQ(true), NE(true), LT(true), LE(true), GT(true), GE(true); + Contains(false, true), NotContains(false, true), Matches(false, true), + NotMatches(false, true), Present(false, false), NotPresent(false, false), + EQ(true, true), NE(true, true), LT(true, true), LE(true, true), + GT(true, true), GE(true, true); private static Map displayNames = new HashMap<>(); private boolean numeric; - Condition(boolean isNumeric) + private boolean needsAPattern; + + Condition(boolean isNumeric, boolean needsPattern) { numeric = isNumeric; + needsAPattern = needsPattern; } /** @@ -36,6 +40,17 @@ public enum Condition } /** + * Answers true if the condition requires a pattern to compare against, else + * false + * + * @return + */ + public boolean needsAPattern() + { + return needsAPattern; + } + + /** * Answers a display name for the match condition, suitable for showing in * drop-down menus. The value may be internationalized using the resource key * "label.matchCondition_" with the enum name appended.