Example #1
0
 /**
  * Returns a classifier's numerosity (the number of microclassifiers).
  *
  * @param aClassifier the classifier
  * @return the given classifier's numerosity
  */
 public final int getClassifierNumerosity(final Classifier aClassifier) {
   for (int i = 0; i < myMacroclassifiers.size(); i++) {
     if (myMacroclassifiers.elementAt(i).myClassifier.getSerial() == aClassifier.getSerial())
       return this.myMacroclassifiers.elementAt(i).numerosity;
   }
   return 0;
 }
Example #2
0
  /**
   * Removes a micro-classifier from the set. It either completely deletes it (if the classsifier's
   * numerosity is 0) or by decreasing the numerosity.
   *
   * @param aClassifier the classifier to delete
   */
  public final void deleteClassifier(final Classifier aClassifier) {

    int index;
    final int macroSize = myMacroclassifiers.size();
    for (index = 0; index < macroSize; index++) {
      if (myMacroclassifiers.elementAt(index).myClassifier.getSerial() == aClassifier.getSerial())
        break;
    }

    if (index == macroSize) return;
    deleteClassifier(index);
  }