Cream.AllenTemporal.AllenDomain.Delete C# (CSharp) Method

Delete() public method

Deletes the specified elem.
public Delete ( int elem ) : AllenDomain
elem int The elem.
return AllenDomain
        public virtual AllenDomain Delete(int elem)
        {
            if (!CONTAINS(elem))
                return this;
            var d = (AllenDomain)Clone();
            d.Remove(elem);
            return d;
        }

Same methods

AllenDomain::Delete ( int lo, int hi ) : AllenDomain
AllenDomain::Delete ( Object o ) : Domain

Usage Example

Beispiel #1
0
        /// <summary>
        /// Caps the interval.
        /// </summary>
        /// <param name="lo">The lo.</param>
        /// <param name="hi">The hi.</param>
        /// <returns></returns>
        public virtual AllenDomain CapInterval(int lo, int hi)
        {
            AllenDomain d = this;

            if (MinValue < lo)
            {
                d = d.Delete(MinValue, lo - 1);
            }
            if (hi < MaxValue)
            {
                d = d.Delete(hi + 1, MaxValue);
            }
            return(d);
        }