Beispiel #1
0
        /// <summary>
        /// Get the subset of two lists.
        /// All data in "this" list that is not contained
        /// in parameter "data" is removed from this list.
        /// </summary>
        /// <param name='data'>The data list to compare with.</param>
        public virtual void Subset(DataIdList data)
        {
            Int32 index;

            if (this.IsNotEmpty())
            {
                for (index = this.Count - 1; index >= 0; index--)
                {
                    if (data.IsEmpty() || !data.Exists(((DataId)(this[index])).Id))
                    {
                        this.RemoveAt(index);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Get the union of two lists.
        /// All taxon names in this list whose taxon that is not
        /// contained in the taxa list is removed from this list.
        /// </summary>
        /// <param name='taxa'>The taxa list to compare with.</param>
        public override void Subset(DataIdList taxa)
        {
            Int32 index;

            if (this.IsNotEmpty())
            {
                for (index = this.Count - 1; index >= 0; index--)
                {
                    if (taxa.IsEmpty() || !taxa.Exists(((TaxonName)(this[index])).TaxonId))
                    {
                        this.RemoveAt(index);
                    }
                }
            }
        }