public class TextRule extends AttributeRule<java.lang.String>
TextRule
provides a selection mechanism for
features based on the string value of one of the attributes.Modifier and Type | Class and Description |
---|---|
static class |
TextRule.Operator
The operators for this class of rule.
|
matchAttName, matchAttValue, nameMap, operator
Constructor and Description |
---|
TextRule(java.lang.String attName,
java.util.Map<java.lang.String,java.lang.Integer> nameMap,
java.lang.String textValue)
Creates a new text rule.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] argv)
Tests this class.
|
boolean |
matches(Feature feature)
Determines if a feature matches the rule.
|
java.lang.Enum[] |
operators()
Gets an array of operators that are valid for this rule.
|
clone, getAttribute, getOperator, getValue, setAttribute, setOperator, setValue, toString
public TextRule(java.lang.String attName, java.util.Map<java.lang.String,java.lang.Integer> nameMap, java.lang.String textValue)
attName
- the attribute name to use for matching.nameMap
- the name to index mapping.textValue
- the text value to use for matching.public java.lang.Enum[] operators()
AttributeRule
operators
in class AttributeRule<java.lang.String>
public boolean matches(Feature feature)
SelectionRule
feature
- the feature to check.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception