Beispiel #1
0
        /// <summary>
        /// Checks whether the <see cref="agetable"/> fits to self.
        /// </summary>
        /// <returns><c>true</c> if age table if valid, <c>false</c> otherwise.</returns>
        /// <remarks>Also returns <c>true</c> if there is no age table.</remarks>
        public Boolean AgeTableValid()
        {
            var result = true;

            if (agetable != null && agetable.age.Any())
            {
                var ageSum = new PopulationDataPoint();
                foreach (var ageEntry in agetable.age)
                {
                    ageSum.Add(ageEntry);
                }
                ageSum.Add(agetable.unknown);
                result &= ageSum.IsEqual(this);
            }

            return(result);
        }