public class Trio
extends java.lang.Object
Auxiliar class.<\i> It counts the number of instances (positive and negative) that contains a given value. of a given attribute in a dataset.
Constructor and Description |
---|
Trio()
Default constructor.
|
Trio(double clave)
Constructs a Trio with the given value and 0 instaces for both positives and negatives.
|
Trio(double clave,
double value,
int sign)
Constructs a Trio with the given value and 0 instaces for both positives and negatives.
|
Modifier and Type | Method and Description |
---|---|
void |
addNegative(double value)
Increases the number of negative instances of a given dataset that contains the value.
|
void |
addPositive(double value)
Increases the number of positive instances of a given dataset that contains the value.
|
double |
getKey()
Returns the attribute's value.
|
double |
getNegative()
Returns the number of negative instances of a given dataset that contains the value.
|
double |
getPositive()
Returns the number of positive instances of a given dataset that contains the value.
|
void |
setKey(double clave)
Sets the attribute'value to a new value.
|
java.lang.String |
toString()
Returns a string that represent a Trio.
|
java.lang.String |
toString(int i)
Returns a string that represent a Trio, taking into account the given attribute's id.
|
public Trio()
public Trio(double clave)
clave
- the attribute's value.public Trio(double clave, double value, int sign)
clave
- the attribute's value.value
- initial valuesign
- whether value goes to positives or to negativespublic double getKey()
public double getPositive()
public double getNegative()
public void setKey(double clave)
clave
- the new attribute's value.public void addPositive(double value)
value
- the adding valuepublic void addNegative(double value)
value
- the adding valuepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int i)
i
- int the attribute's id.