public Boolean IsGeneralizationOfThis(TaxonomicClassification taxonomicClassification)
        {
            if (this == taxonomicClassification)
            {
                return(false);
            }

            for (var index = 0; index < _taxonomy.Count; index++)
            {
                var myClassification    = _taxonomy[index].Value;
                var theirClassification = taxonomicClassification._taxonomy[index].Value;

                if (String.IsNullOrEmpty(myClassification) && !String.IsNullOrEmpty(theirClassification))
                {
                    return(true);
                }

                if (!String.IsNullOrEmpty(myClassification) && String.IsNullOrEmpty(theirClassification))
                {
                    return(false);
                }

                if (!String.Equals(myClassification, theirClassification, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(false);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 private SpeciesInfo(TaxonomicClassification taxonomy, String commonName, String tagName, Double probability)
 {
     _name    = commonName;
     _tagName = tagName;
     _independentProbability = probability;
     _taxonomy = taxonomy;
 }
Exemplo n.º 3
0
        public static SpeciesInfo GetInstance(TaxonomicClassification taxonomy, String commonName, String tagName, Double probability)
        {
            if (String.IsNullOrEmpty(tagName) || taxonomy == TaxonomicClassification.NULL)
            {
                return(NULL);
            }

            return(new SpeciesInfo(taxonomy, commonName, tagName, probability));
        }
        public Boolean Equals(TaxonomicClassification taxonomicClassification)
        {
            for (var index = 0; index < _taxonomy.Count; index++)
            {
                var myClassification    = _taxonomy[index].Value;
                var theirClassification = taxonomicClassification._taxonomy[index].Value;

                if (!String.Equals(myClassification, theirClassification, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(false);
                }
            }

            return(true);
        }