Package org.yamcs.xtce
Class Comparison
- java.lang.Object
-
- org.yamcs.xtce.Comparison
-
- All Implemented Interfaces:
Serializable,MatchCriteria
public class Comparison extends Object implements MatchCriteria
A simple ParameterInstanceRef to value comparison. DIFFERS_FROM_XTCE: 1) in xtce the value is stored as a string and it's not very clear how it's compared with an integer 2) in xtce Comparison extends ParameterInstanceRef, and MatchCriteria is a choice of Comparison, ComparisonList, ...- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.yamcs.xtce.MatchCriteria
ALWAYS_MATCH
-
-
Constructor Summary
Constructors Constructor Description Comparison(ParameterInstanceRef paraRef, double doubleValue, OperatorType op)Comparison(ParameterInstanceRef paraRef, int intValue, OperatorType op)Comparison(ParameterInstanceRef paraRef, long longValue, OperatorType op)Comparison(ParameterInstanceRef paraRef, String stringValue, OperatorType op)Makes a new comparison with a generic stringValue at this step the paraRef could be pointing to an unknown parameter. resolveValueType can(should) be called later to create the correct value if it's not string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OperatorTypegetComparisonOperator()Set<Parameter>getDependentParameters()Return the set of parameters which are required in order to evaluate the match criteria.ParametergetParameter()ParameterInstanceRefgetParameterRef()StringgetStringValue()ObjectgetValue()booleanisMet(CriteriaEvaluator evaluator)Return true if the condition matchesvoidresolveValueType()Called when the type of the parameter used for comparison is known, so we have to find the value from stringValue that we can compare to itStringtoExpressionString()StringtoString()
-
-
-
Constructor Detail
-
Comparison
public Comparison(ParameterInstanceRef paraRef, String stringValue, OperatorType op)
Makes a new comparison with a generic stringValue at this step the paraRef could be pointing to an unknown parameter. resolveValueType can(should) be called later to create the correct value if it's not string- Parameters:
paraRef-stringValue-op-
-
Comparison
public Comparison(ParameterInstanceRef paraRef, int intValue, OperatorType op)
-
Comparison
public Comparison(ParameterInstanceRef paraRef, long longValue, OperatorType op)
-
Comparison
public Comparison(ParameterInstanceRef paraRef, double doubleValue, OperatorType op)
-
-
Method Detail
-
isMet
public boolean isMet(CriteriaEvaluator evaluator)
Description copied from interface:MatchCriteriaReturn true if the condition matches- Specified by:
isMetin interfaceMatchCriteria- Returns:
-
toExpressionString
public String toExpressionString()
- Specified by:
toExpressionStringin interfaceMatchCriteria
-
resolveValueType
public void resolveValueType()
Called when the type of the parameter used for comparison is known, so we have to find the value from stringValue that we can compare to it
-
getParameterRef
public ParameterInstanceRef getParameterRef()
-
getComparisonOperator
public OperatorType getComparisonOperator()
-
getDependentParameters
public Set<Parameter> getDependentParameters()
Description copied from interface:MatchCriteriaReturn the set of parameters which are required in order to evaluate the match criteria. If no parameter is required, return an empty set.- Specified by:
getDependentParametersin interfaceMatchCriteria- Returns:
-
getParameter
public Parameter getParameter()
-
getValue
public Object getValue()
-
getStringValue
public String getStringValue()
-
-