public class TaxonComparator extends java.lang.Object implements java.util.Comparator<TaxonBase>, java.io.Serializable
taxa
by
comparing the publication dates of the corresponding
taxon names
.Constructor and Description |
---|
TaxonComparator() |
TaxonComparator(boolean includeRanks) |
Modifier and Type | Method and Description |
---|---|
int |
compare(TaxonBase taxonBase1,
TaxonBase taxonBase2)
Returns an integer generated by comparing first the nomenclatural status and then the
publication years
of both taxon names
used in the given taxa . |
protected int |
compare(TaxonName name1,
TaxonName name2,
boolean includeNomIlleg) |
protected int |
compareNomIlleg(TaxonName taxonName1,
TaxonName taxonName2) |
protected int |
compareStatus(TaxonName taxonName,
TaxonName taxonName2) |
public TaxonComparator()
includeRanks
- public TaxonComparator(boolean includeRanks)
includeRanks
- public int compare(TaxonBase taxonBase1, TaxonBase taxonBase2)
publication years
of both taxon names
used in the given taxa
.
If 1 name has status of type nom. inval. or nom. nudum the name is put to the end of a
list (returns +1 for a status in taxon1 and -1 for a status in taxon2). If both do have
no status or the same status, the publication date is taken for comparison.
Nom. nudum is handled as more "severe" status then nom.inval.
Returns a negative value if the publication year corresponding to the
first given taxon precedes the publication year corresponding to the
second given taxon. Returns a positive value if the contrary is true and
0 if both publication years and the date, when they are created, are identical.
In case one of the publication
years is "null" and the other is not, the "empty" publication year will
be considered to be always preceded by the "not null" publication year.
If both publication years are "null" the creation date is used for the comparisoncompare
in interface java.util.Comparator<TaxonBase>
String.compareTo(String)
,
Comparator.compare(java.lang.Object, java.lang.Object)
protected int compareStatus(TaxonName taxonName, TaxonName taxonName2)
taxonName
- taxonName2
- statusCompareWeight
- protected int compare(TaxonName name1, TaxonName name2, boolean includeNomIlleg)
name1
- name2
- includeNomIlleg
- if true and if both names have no date or same date, the only
name having nom. illeg. state is handled as if the name was published later than the name
without status nom. illeg.Copyright © 2007-2020 EDIT. All Rights Reserved.