public class Selector
extends java.lang.Object
implements java.lang.Comparable
Structure for storing one condition of the antecedent of a rule
Constructor and Description |
---|
Selector(int attr,
int op,
double[] val,
int util,
int numI)
Class that stores datasets with the form: (attribute operator values)
|
Selector(int attr,
int op,
java.lang.String[] nomi,
double[] num,
int util,
int numI)
Class that stores selectors with the form: (attribute operator values) where values are nominal
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o)
Function for comparing two objects of the selector class
|
int |
equivalents(java.lang.Object o)
Returns 0 if the selectors are equivalents
|
double |
get1Value()
Returns the value or high extrem of the associated attribute
|
int |
getAttribute()
Return the id of the attribute
|
int[] |
getNumInstances()
Returns the numebr of instances
|
int |
getNumValues()
Returns the number of values
|
java.lang.String |
getNValue()
Returns the nominal value of the attribute
|
java.lang.String[] |
getNValues()
Returns the set of nominal values ofthe selector
|
int |
getOperator()
Returns the id of the operator
|
double[] |
getValues()
Returns the set of values of the selector
|
double |
getZeroValue()
Returns the value or less extrem of the associated attribute
|
boolean |
isNominal()
Returns nominal attribute
|
void |
print()
Shows the content of the selector selector:
Attribute - operator - value
|
void |
setAttributeValue(int i)
Assigns the attribute
|
void |
setNumLow(int num)
Set the low number
|
void |
setNumUp(int num)
Set the high number
|
void |
setOperator(int i)
Assigns the operator
|
void |
setValue(double f)
Assigns the value
|
void |
setValues(double[] f)
Assigns the values
|
public Selector(int attr, int op, java.lang.String[] nomi, double[] num, int util, int numI)
Class that stores selectors with the form: (attribute operator values) where values are nominal
attr
- attributeop
- operatornomi
- nominal valuesnum
- the values in numerical wayutil
- the number of valuesnumI
- the position in the datasetpublic Selector(int attr, int op, double[] val, int util, int numI)
Class that stores datasets with the form: (attribute operator values)
attr
- attributeop
- operatorval
- the set of valuesutil
- the number of valuesnumI
- the position in the datasetpublic int compareTo(java.lang.Object o)
Function for comparing two objects of the selector class
compareTo
in interface java.lang.Comparable
o
- object to comparepublic int equivalents(java.lang.Object o)
Returns 0 if the selectors are equivalents
o
- Selectorpublic int getAttribute()
Return the id of the attribute
public int getOperator()
Returns the id of the operator
public double getZeroValue()
Returns the value or less extrem of the associated attribute
public double get1Value()
Returns the value or high extrem of the associated attribute
public java.lang.String getNValue()
Returns the nominal value of the attribute
public double[] getValues()
Returns the set of values of the selector
public java.lang.String[] getNValues()
Returns the set of nominal values ofthe selector
public int getNumValues()
Returns the number of values
public int[] getNumInstances()
Returns the numebr of instances
public boolean isNominal()
Returns nominal attribute
public void setNumUp(int num)
Set the high number
num
- high numberpublic void setNumLow(int num)
Set the low number
num
- low numberpublic void setAttributeValue(int i)
Assigns the attribute
i
- value of the attributepublic void setOperator(int i)
Assigns the operator
i
- value of the operatorpublic void setValue(double f)
Assigns the value
f
- valuepublic void setValues(double[] f)
Assigns the values
f
- valuespublic void print()
Shows the content of the selector selector: Attribute - operator - value