public class Atributo
extends java.lang.Object
This class implements an attribute.
Description: Implements the attributes representation as a pair of the attribute id and its value used by the ACO algorithm to build the dataset and the conditions for the rules.Constructor and Description |
---|
Atributo()
Default constructor.
|
Atributo(Atributo original)
Copy Constructor.
|
Atributo(float valorOriginal,
int atributoOriginal,
int tip)
Parameter constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two attributes.
|
boolean |
equals(java.lang.Object obj)
Checks if this attribute is equal to the one given.
|
boolean |
esIgual(Atributo at)
Checks if this attribute is equal to the one given.
|
int |
getAtributo()
Returns the attribute id represented on this object.
|
int |
getTipo()
Returns the attribute type.
|
float |
getValor()
Returns the assigned value of the attribute.
|
void |
imprime(java.lang.String cadena)
Prints the information of the attribute.
|
static ComparadorAtributo |
obtenerComparador()
Returns the compare condition to compare two attributes.
|
void |
setTipo(int tip)
Sets the attribute type with the one given: numeric (0) or nominal (1).
|
void |
setValor(float at)
Sets the attribute's value with the one given.
|
void |
sumarValor(float v)
Sums the value given to the one stored.
|
public Atributo()
public Atributo(float valorOriginal, int atributoOriginal, int tip)
valorOriginal
- Initial value of the attribute.atributoOriginal
- Identifies the attribute to be represented. (attribute id).tip
- Attribute type: numeric (0) or nominal (1).public Atributo(Atributo original)
original
- Attribute to be copied.public int getAtributo()
public float getValor()
public int compare(java.lang.Object o1, java.lang.Object o2)
o1
- Object First attribute to compare with.o2
- Object Second attribute to compare with.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object Attribute to compare with.public boolean esIgual(Atributo at)
at
- Object Attribute to compare with.public static ComparadorAtributo obtenerComparador()
ComparadorAtributo
the compare condition.public int getTipo()
public void setTipo(int tip)
tip
- given type.public void sumarValor(float v)
v
- given value.public void imprime(java.lang.String cadena)
cadena
- title or name of the attribute.public void setValor(float at)
at
- value to set.