Antlr4.Runtime.Misc.Interval.DifferenceNotProperlyContained C# (CSharp) Method

DifferenceNotProperlyContained() public method

Return the interval with elements from this not in other ; other must not be totally enclosed (properly contained) within this , which would result in two disjoint intervals instead of the single one returned by this method.
public DifferenceNotProperlyContained ( Antlr4 other ) : Antlr4.Runtime.Misc.Interval?
other Antlr4
return Antlr4.Runtime.Misc.Interval?
        public Antlr4.Runtime.Misc.Interval? DifferenceNotProperlyContained(Antlr4.Runtime.Misc.Interval other)
        {
            Antlr4.Runtime.Misc.Interval? diff = null;
            // other.a to left of this.a (or same)
            if (other.StartsBeforeNonDisjoint(this))
            {
                diff = Antlr4.Runtime.Misc.Interval.Of(Math.Max(this.a, other.b + 1), this.b);
            }
            else
            {
                // other.a to right of this.a
                if (other.StartsAfterNonDisjoint(this))
                {
                    diff = Antlr4.Runtime.Misc.Interval.Of(this.a, other.a - 1);
                }
            }
            return diff;
        }