public class NumberRule extends AttributeRule<java.lang.Number>
NumberRule
provides a selection mechanism for
features based on the numercial value of one of the attributes.Modifier and Type | Class and Description |
---|---|
static class |
NumberRule.Operator
The operators for this class of rule.
|
matchAttName, matchAttValue, nameMap, operator
Constructor and Description |
---|
NumberRule(java.lang.String attName,
java.util.Map<java.lang.String,java.lang.Integer> nameMap,
java.lang.Number numberValue)
Creates a new number 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 NumberRule(java.lang.String attName, java.util.Map<java.lang.String,java.lang.Integer> nameMap, java.lang.Number numberValue)
attName
- the attribute name to use for matching.nameMap
- the name to index mapping.numberValue
- the number value to use for matching.public java.lang.Enum[] operators()
AttributeRule
operators
in class AttributeRule<java.lang.Number>
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