org.wwbota.identification
Class StandardDescription

java.lang.Object
  |
  +--org.wwbota.identification.StandardDescription
All Implemented Interfaces:
Description

public class StandardDescription
extends java.lang.Object
implements Description

This is a generic implementation, since it gets the information by iterating on all criteria, and calling the isCompatibleWith() function on each. This is a simple implementation, since it just takes the minimum of probabilities for all characters. It can be expanded to have a more sophisticated or optimized implementation.


Constructor Summary
StandardDescription(Taxon taxon)
           
 
Method Summary
 void addCriterion(Criterion c)
          Add a Character-Criterion pair
 Criterion getCriterion(Character c)
          Accessor to Criterion from Character.
 java.util.Map getMap()
           
 Taxon getTaxon()
          Accessor to the Taxon (item) being described
 double isCompatibleWith(Description reference)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardDescription

public StandardDescription(Taxon taxon)
Method Detail

getTaxon

public Taxon getTaxon()
Description copied from interface: Description
Accessor to the Taxon (item) being described
Specified by:
getTaxon in interface Description

getMap

public java.util.Map getMap()
Specified by:
getMap in interface Description
Returns:
a Map of Criterion objects; the key is the corresponding Character

addCriterion

public void addCriterion(Criterion c)
Description copied from interface: Description
Add a Character-Criterion pair
Specified by:
addCriterion in interface Description

getCriterion

public Criterion getCriterion(Character c)
Accessor to Criterion from Character. This is a helper function, since the getMap() accessor gives the same information, plus the ability to iterate on all criteria
Specified by:
getCriterion in interface Description

isCompatibleWith

public double isCompatibleWith(Description reference)
Specified by:
isCompatibleWith in interface Description
Returns:
the probability that this Description corresponds to the given reference. Simply takes the minimum of probabilities for all characters.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object