Ejemplo n.º 1
0
        public int CompareTo(ITaxonRank other)
        {
            if (Type != TaxonRankType.Custom && other.Type != TaxonRankType.Custom)
            {
                // The order of the values in the enum corresponds to their hierarchical order.

                return(Type.CompareTo(other.Type));
            }
            else if (Suffix == other.Suffix)
            {
                // For custom ranks, we need to infer the hierarchical order based on the name of the rank.
                // This requires that both rank suffixes are "known". If they're not, we can't compare them.

                return(Prefix.CompareTo(other.Prefix));
            }
            else
            {
                // The comparison could not be performed.
                return(0);
            }
        }
Ejemplo n.º 2
0
 public Taxon(TaxonRankType rank, string name)
 {
     this.Name = name;
     this.Rank = new TaxonRank(rank);
 }