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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StandardDescription
public StandardDescription(Taxon taxon)
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