net.java.quickcheck.characteristic
Class Classification

java.lang.Object
  extended by net.java.quickcheck.characteristic.Classification

public class Classification
extends Object

Gather frequency information about test values.

Classifications are used to categories test cases. While Characteristic.specify(Object) is executed characteristic instances can add classifications with doClassify(boolean, Object). For each execution of Characteristic.specify(Object) call() has to be executed once.


Constructor Summary
Classification()
           
 
Method Summary
 void call()
          Count the number of calls.
 void classifyCall(boolean predicate, Object classification)
           
 void classifyCall(Object classification)
           
 void doClassify(boolean predicate, Object classification)
          Increment the classification counter for the given classification.
 void doClassify(Object classification)
           
 List<Object> getCategories()
          Get a list of known categories.
 double getFrequency(Object classification)
          Get the frequency of the given category.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Classification

public Classification()
Method Detail

getFrequency

public double getFrequency(Object classification)
Get the frequency of the given category.

Returns:
per cent of test cases with this classification.

getCategories

public List<Object> getCategories()
Get a list of known categories. Categories are sorted in descending frequency.


toString

public String toString()

Overrides:
toString in class Object

doClassify

public void doClassify(Object classification)

doClassify

public void doClassify(boolean predicate,
                       Object classification)
Increment the classification counter for the given classification.

Parameters:
predicate - increment only if the predicate is true.
classification - classification key

call

public void call()
Count the number of calls.


classifyCall

public void classifyCall(boolean predicate,
                         Object classification)

classifyCall

public void classifyCall(Object classification)


Copyright © 2011. All Rights Reserved.