1 package jalview.util.matcher;
3 import jalview.util.MessageManager;
5 import java.util.HashMap;
9 * An enumeration for binary conditions that a user might choose from when
10 * setting filter or match conditions for values
14 Contains(false, true), NotContains(false, true), Matches(false, true),
15 NotMatches(false, true), Present(false, false), NotPresent(false, false),
16 EQ(true, true), NE(true, true), LT(true, true), LE(true, true),
17 GT(true, true), GE(true, true);
19 private static Map<Condition, String> displayNames = new HashMap<>();
21 private boolean numeric;
23 private boolean needsAPattern;
25 Condition(boolean isNumeric, boolean needsPattern)
28 needsAPattern = needsPattern;
32 * Answers true if the condition does a numerical comparison, else false
37 public boolean isNumeric()
43 * Answers true if the condition requires a pattern to compare against, else
48 public boolean needsAPattern()
54 * Answers a display name for the match condition, suitable for showing in
55 * drop-down menus. The value may be internationalized using the resource key
56 * "label.matchCondition_" with the enum name appended.
61 public String toString()
63 String name = displayNames.get(this);
69 .getStringOrReturn("label.matchCondition_", name());
70 displayNames.put(this, name);