|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectKnnMethod.Classes.Distance
public class Distance
The class to store the distance between testing and training item. It also stored the name of an item and its index.
Constructor Summary | |
---|---|
Distance(int i,
double l,
java.lang.String c)
|
Method Summary | |
---|---|
int |
compareTo(Distance o)
Compares distances of objects. |
java.lang.String |
getClassInRow()
Gets the class name, for which the distance is stored. |
double |
getIndex()
Method, which returns the value of index for the training table. |
double |
getVzdalenost()
Gets the object's stored distance. |
void |
setClassInRow(java.lang.String classInRow)
Stores the class name for faster access. |
void |
setIndex(int newIndex)
Stores the index into the training table. |
void |
setVzdalenost(double newVzdalenost)
Stores the new value of distance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Distance(int i, double l, java.lang.String c)
Method Detail |
---|
public java.lang.String getClassInRow()
public void setClassInRow(java.lang.String classInRow)
classInRow
- class name, for which the distance is counted.public double getIndex()
public void setIndex(int newIndex)
newIndex
- new value of index in the training table.public double getVzdalenost()
public void setVzdalenost(double newVzdalenost)
newVzdalenost
- the new value of object's distancepublic int compareTo(Distance o)
compareTo
in interface java.lang.Comparable<Distance>
o
- the object to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |