|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rdr.core.Condition
public class Condition
A single condition of a rule Comprised of an attribute, an operator (==, !=, >= etc.), and a comparison value. i.e. "attrA == 5"
Constructor Summary | |
---|---|
Condition(Attribute attr,
int op,
int valueType,
java.lang.Object value)
Constructor. |
|
Condition(Attribute attr,
int op,
Value value)
Constructor. |
|
Condition(Attribute attr,
Operator op,
int valueType,
java.lang.Object value)
Constructor. |
|
Condition(Attribute attr,
Operator op,
Value value)
Constructor. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object c)
Returns true if the parameter c has the same values as this object |
Attribute |
getAttribute()
|
Operator |
getOperator()
|
int |
getOperatorOpposite()
Gets the opposite value for the operator |
int |
getType()
Get the type code of this attribute's value |
Value |
getValue()
|
boolean |
isBooleanAttributeSatisfied(Case c)
Is the boolean attribute in case c satisfied by this condition |
boolean |
isNominalAttributeSatisfied(Case c)
Is the nominal attribute in this condition satisfied by the case c TODO: method is untested. |
boolean |
isNumericAttributeSatisfied(Case c)
is the numeric attribute in case c satisfied by this condition |
boolean |
isSatisfied(Case c)
Check to see if a case satisfies this condition |
void |
setAttribute(Attribute attr)
Set the attribute |
void |
setOperator(int op)
Set the operator |
void |
setValue(Value comparisonValue)
set the value of this condition |
void |
setValueType(int comparisonValueType)
Sets the type of the value |
java.lang.String |
toString()
Convert this condition into a readable string |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Condition(Attribute attr, int op, Value value)
attr
- the attribute i.e. ageop
- the operator code i.e. Operator.EQUALSvalue
- the comparison value i.e. 25public Condition(Attribute attr, int op, int valueType, java.lang.Object value)
attr
- the attribute i.e. ageop
- the operator code i.e. Operator.EQUALSvalueType
- the type of the comparison value i.e. Type.NUMERICvalue
- the comparison value i.e. 25public Condition(Attribute attr, Operator op, Value value)
attr
- the attribute i.e. ageop
- the actual operator objectvalue
- the actual value objectpublic Condition(Attribute attr, Operator op, int valueType, java.lang.Object value)
attr
- the attribute i.e. ageop
- the actual operatorvalueType
- the type code of the value i.e. Type.NUMERICvalue
- the value i.e. 25Method Detail |
---|
public Attribute getAttribute()
public void setAttribute(Attribute attr)
attr
- the attribute to setpublic Operator getOperator()
public void setOperator(int op)
op
- the operator code i.e. Operator.LESS_THANpublic Value getValue()
public void setValue(Value comparisonValue)
comparisonValue
- the comparison value you wantpublic int getType()
public void setValueType(int comparisonValueType)
comparisonValueType
- the type code for the comparison valuepublic boolean equals(java.lang.Object c)
equals
in class java.lang.Object
c
- the condition to compare against
public java.lang.String toString()
toString
in class java.lang.Object
public int getOperatorOpposite()
public boolean isSatisfied(Case c)
c
- the case
public boolean isNumericAttributeSatisfied(Case c)
c
- the case to check satisfaction with
public boolean isNominalAttributeSatisfied(Case c)
c
- the case to test
public boolean isBooleanAttributeSatisfied(Case c)
c
- the case to test
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |