Package noaa.coastwatch.render.feature
Class AttributeRule<T>
java.lang.Object
noaa.coastwatch.render.feature.AttributeRule<T>
- All Implemented Interfaces:
Cloneable
,SelectionRule
- Direct Known Subclasses:
DateRule
,NumberRule
,TextRule
,TimeWindowRule
An
AttributeRule
provides a selection mechanism for
features based on the value of one of the attributes. If a feature has an
attribute value that matches, it is considered a matching
feature. If the feature attribute value is null, the feature is
non-matching no matter what operator is used. The actual matching
operation is left to the subclass depending on the attribute type.- Since:
- 3.3.2
- Author:
- Peter Hollemans
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Gets the attribute name for this rule.Gets the current rule operator.getValue()
Gets the attribute value for this rule.abstract Enum[]
Gets an array of operators that are valid for this rule.void
setAttribute
(String attName) Sets the attribute name for this rule.void
setOperator
(Enum operator) Sets the rule operator.void
Sets the attribute value for this rule.toString()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface noaa.coastwatch.render.feature.SelectionRule
matches
-
Field Details
-
matchAttName
The attribute to use for matching. -
matchAttValue
The attribute value to use for matching. -
nameMap
The map to use to translate name to index for attributes. -
operator
Thee rule operator currently being used.
-
-
Constructor Details
-
AttributeRule
Creates a new attribute rule.- Parameters:
attName
- the attribute name to use for matching.nameMap
- the name to index mapping for attributes.attValue
- the attribute value to use for matching.- Throws:
RuntimeException
- if the attribute name has no valid mapping to an index.
-
-
Method Details
-
clone
-
getAttribute
Gets the attribute name for this rule.- Returns:
- the attribute name used by this rule for matching.
-
setAttribute
Sets the attribute name for this rule.- Parameters:
attName
- the attribute name to use for matching.- Throws:
RuntimeException
- if the attribute name has no valid mapping to an index.
-
getValue
Gets the attribute value for this rule.- Returns:
- the attribute value used by this rule for matching.
-
setValue
Sets the attribute value for this rule.- Parameters:
attValue
- the attribute value to use for matching.
-
operators
Gets an array of operators that are valid for this rule.- Returns:
- the array of valid operators.
-
getOperator
Gets the current rule operator.- Returns:
- the current operator.
-
setOperator
Sets the rule operator.- Parameters:
operator
- the new rule operator.
-
toString
-