public class SimpleRule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
EQUAL
Flag for equal operator
|
static int |
GREATER
Flag for greater operator
|
static int |
LOWER
Flag for lower operator
|
Constructor and Description |
---|
SimpleRule()
Default constructor (the attribute's id and value are undefined)
|
SimpleRule(int attribute,
double value,
int operator)
Constructs a SimpleRule with a given attribute and value
|
Modifier and Type | Method and Description |
---|---|
int |
getAttribute()
Returns the attribute's id
|
SimpleRule |
getCopy()
It returns a copy of this simple rule
|
int |
getOperator()
Returns the operator of the rule
|
double |
getValue()
Returns the value of the attribute
|
boolean |
isContinous()
Returns true if the attribute is continous
|
boolean |
isDiscret()
Returns true if the attribute is discret
|
boolean |
isEqual(SimpleRule sr)
Return wether this simple rule is equal to another given simple rule
|
void |
set(int attribute,
double value,
int operator)
Sets the attribute's id and the attribute's value
|
void |
setAttribute(int attribute)
Sets the attribute's id and the attribute's value
|
void |
setOperator(int operator)
Sets the rule operator
|
void |
setValue(double value)
Sets the attribute's value
|
java.lang.String |
toString()
Returns a string representation of this SimpleRule
|
public static int GREATER
public static int LOWER
public static int EQUAL
public SimpleRule()
public SimpleRule(int attribute, double value, int operator)
attribute
- int attribute's id (position of the attribute)value
- double attribute's valueoperator
- int rule operator: >, = ó <=public int getAttribute()
public double getValue()
public int getOperator()
public boolean isDiscret()
public boolean isContinous()
public void set(int attribute, double value, int operator)
attribute
- int attribute's id (position of the attribute)value
- attribute's valueoperator
- int rule operator: >, = ó <=public void setAttribute(int attribute)
attribute
- int attribute's id (position of the attribute)public void setValue(double value)
value
- attribute's valuepublic void setOperator(int operator)
operator
- int rule operator: >, = ó <=public boolean isEqual(SimpleRule sr)
sr
- SimpleRule the given simple rulepublic SimpleRule getCopy()
public java.lang.String toString()
toString
in class java.lang.Object