Exemple #1
0
        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);
        }
Exemple #2
0
 /// <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);
 }
Exemple #3
0
 /// <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);
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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)));
 }
Exemple #6
0
 public bool ProperlyContains(erl.Oracle.TnsNames.Antlr4.Runtime.Misc.Interval other)
 {
     return(other.a >= this.a && other.b <= this.b);
 }
Exemple #7
0
 /// <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);
 }
Exemple #8
0
 // 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));
 }
Exemple #9
0
 /// <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);
 }