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);
        }
예제 #2
0
 private SpeciesInfo(TaxonomicClassification taxonomy, String commonName, String tagName, Double probability)
 {
     _name    = commonName;
     _tagName = tagName;
     _independentProbability = probability;
     _taxonomy = taxonomy;
 }
예제 #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);
        }