Lines Matching refs:Interval
31 public class Interval {
34 static Interval[] cache = new Interval[INTERVAL_POOL_MAX_VALUE+1];
44 public Interval(int a, int b) { this.a=a; this.b=b; }
46 /** Interval objects are used readonly so share all with the
49 * Interval object with a..a in it. On Java.g, 218623 IntervalSets
52 public static Interval create(int a, int b) {
53 //return new Interval(a,b);
56 return new Interval(a,b);
59 cache[a] = new Interval(a,a);
68 Interval other = (Interval)o;
73 public boolean startsBeforeDisjoint(Interval other) {
78 public boolean startsBeforeNonDisjoint(Interval other) {
83 public boolean startsAfter(Interval other) { return this.a>other.a; }
86 public boolean startsAfterDisjoint(Interval other) {
91 public boolean startsAfterNonDisjoint(Interval other) {
96 public boolean disjoint(Interval other) {
101 public boolean adjacent(Interval other) {
105 public boolean properlyContains(Interval other) {
110 public Interval union(Interval other) {
111 return Interval.create(Math.min(a,other.a), Math.max(b,other.b));
115 public Interval intersection(Interval other) {
116 return Interval.create(Math.max(a,other.a), Math.min(b,other.b));
124 public Interval differenceNotProperlyContained(Interval other) {
125 Interval diff = null;
128 diff = Interval.create(Math.max(this.a,other.b+1),
134 diff = Interval.create(this.a, other.a-1);