public override bool Equals(object o) { if (!(o is erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval)) { return(false); } erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other = (erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval)o; return(this.a == other.a && this.b == other.b); }
/// <summary>Does this.a start after other.b? May or may not be disjoint</summary> public bool StartsAfter(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(this.a > other.a); }
/// <summary>Does this start at or before other? Nondisjoint</summary> public bool StartsBeforeNonDisjoint(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(this.a <= other.a && this.b >= other.a); }
/// <summary> /// Return the interval with elements from /// <c>this</c> /// not in /// <paramref name="other"/> /// ; /// <paramref name="other"/> /// must not be totally enclosed (properly contained) /// within /// <c>this</c> /// , which would result in two disjoint intervals /// instead of the single one returned by this method. /// </summary> public erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval?DifferenceNotProperlyContained(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval?diff = null; // other.a to left of this.a (or same) if (other.StartsBeforeNonDisjoint(this)) { diff = erl.Oracle.TnsNames.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 = erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval.Of(this.a, other.a - 1); } } return(diff); }
/// <summary>Return the interval in common between this and o</summary> public erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval Intersection(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval.Of(Math.Max(a, other.a), Math.Min(b, other.b))); }
public bool ProperlyContains(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(other.a >= this.a && other.b <= this.b); }
/// <summary>Are two intervals adjacent such as 0..41 and 42..42?</summary> public bool Adjacent(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(this.a == other.b + 1 || this.b == other.a - 1); }
// this.b>=other.b implied /// <summary>Are both ranges disjoint? I.e., no overlap?</summary> public bool Disjoint(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(StartsBeforeDisjoint(other) || StartsAfterDisjoint(other)); }
/// <summary>Does this start after other? NonDisjoint</summary> public bool StartsAfterNonDisjoint(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other) { return(this.a > other.a && this.a <= other.b); }