public class Condition
extends java.lang.Object
Title: Condition
Description: It represents a rule condition
Constructor and Description |
---|
Condition()
Default builder
|
Condition(int atributo)
Builder for the first condition type (*)
|
Condition(int atributo,
double valor)
Builder for the second condition type (enumerate attributes)
|
Condition(int atributo,
double valor,
double b1,
double b2)
Builder for the third type of condition (real or integer attributes)
|
Modifier and Type | Method and Description |
---|---|
int |
getAtributo()
It returns the attribute id
|
double |
getLowerBound()
It returns the lower bound
|
int |
getType()
It gets the type of the condition
|
double |
getUpperBound()
It returns the upper bound
|
double |
getValue()
It returns the value for the attribute
|
boolean |
isEqual(Condition c)
It checks if the condition is equal to other
|
void |
setAttribute(int att)
It adds the attribute id
|
void |
setLowerBound(double lim)
Sets the lower bound
|
void |
setType(int tip)
It sets the type
|
void |
setUpperBound(double lim)
Sets the upper bound
|
void |
setValue(double val)
It add the value (or a nan if *)
|
public Condition()
public Condition(int atributo)
atributo
- attribute idpublic Condition(int atributo, double valor)
atributo
- attribute idvalor
- the value for the attributepublic Condition(int atributo, double valor, double b1, double b2)
atributo
- attribute idvalor
- the value for the attributeb1
- lower boundb2
- upper boundpublic int getType()
public int getAtributo()
public double getValue()
public double getLowerBound()
public double getUpperBound()
public void setType(int tip)
tip
- Type (0 == *; 1 == [Ai = value]; 2 == [B <= Ai <= B] )public void setAttribute(int att)
att
- the attribute idpublic void setValue(double val)
val
- Value of the condition ("Nan" for type 0; it doesn't exist for type 2)public void setLowerBound(double lim)
lim
- lower boundpublic void setUpperBound(double lim)
lim
- upper boundpublic boolean isEqual(Condition c)
c
- condition for comparison