KnnMethod.Classes
Class KClasses

java.lang.Object
  extended by KnnMethod.Classes.KClasses

public class KClasses
extends java.lang.Object

Class, which computes and stores occurence counts of classified items and returns those ones with highest number of occurences.


Constructor Summary
KClasses()
           
 
Method Summary
 void addClass(java.lang.String newClass)
          Adds a new class for classification.
 java.lang.String getKNNClass()
          Method, which returns the most numerous classification class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KClasses

public KClasses()
Method Detail

addClass

public void addClass(java.lang.String newClass)
Adds a new class for classification. If it wasn't defined, it is added and the count is set to 1. If it was just inserted, the count is incremented by 1.

Parameters:
newClass - the name of the class to be added

getKNNClass

public java.lang.String getKNNClass()
Method, which returns the most numerous classification class. In case of equality of two most numerous classes, the formerly found is returned.

Returns:
name of the most numerous classificaton class