public class Sample
extends java.lang.Object
Stores one data with the form: attribute attribute class
Constructor and Description |
---|
Sample(double[] m,
int c,
int size)
Constructor
|
Sample(int size)
Other constructor, more easy
|
Modifier and Type | Method and Description |
---|---|
boolean |
compare(Sample m)
Checks if the Sample objects are equals
|
Sample |
copySample()
Do a copy of the example
|
int |
getClassSelector()
Returns the example's class
|
int |
getCovered()
Returns the number of times that the example has benn matched
|
int |
getNAttributes()
Returns the number of attributes of the example
|
long |
getPosFile()
Returns the position of the example inf the in-put file of data
|
double[] |
getSample()
Returns the attributes(array of values)
|
double |
getSample(int i)
Returns the value of the attribute 'i' of the example
|
void |
incrementCovered()
Adds one to the number of times that the example has been matched
|
void |
print()
Prints on the screen the example's content
|
void |
setClase(int i)
Assigns the class
|
void |
setCovered(int d)
Assign a new value for the 'n' times that the example has benn matched
|
void |
setPosFile(long l)
Assigns the position of the example in the in-put file of data
|
void |
setSample(double[] ds)
Assigns the in-puts of the data
|
void |
setSample(int i,
double val)
Gives value to an atribute
|
public Sample(double[] m, int c, int size)
Constructor
m
- un Vector of attributes(valores)c
- The owner class of the datasize
- Size of the datapublic Sample(int size)
Other constructor, more easy
size
- The size of the data(n attributes)public int getClassSelector()
Returns the example's class
public double[] getSample()
Returns the attributes(array of values)
public void setClase(int i)
Assigns the class
i
- number of the classpublic void setSample(double[] ds)
Assigns the in-puts of the data
ds
- An array of values for the datapublic long getPosFile()
Returns the position of the example inf the in-put file of data
public void setPosFile(long l)
Assigns the position of the example in the in-put file of data
l
- the position in the filepublic double getSample(int i)
Returns the value of the attribute 'i' of the example
i
- The atribute's positionpublic int getNAttributes()
Returns the number of attributes of the example
public void setSample(int i, double val)
Gives value to an atribute
i
- Position of the attributeval
- new valuepublic void print()
Prints on the screen the example's content
public Sample copySample()
Do a copy of the example
public boolean compare(Sample m)
Checks if the Sample objects are equals
m
- Sample object to compare withpublic int getCovered()
Returns the number of times that the example has benn matched
public void incrementCovered()
Adds one to the number of times that the example has been matched
public void setCovered(int d)
Assign a new value for the 'n' times that the example has benn matched
d
- value