Lines Matching refs:other

43     public function equals(object $other) : bool
45 if ($this === $other) {
49 return $other instanceof self
50 && $this->start === $other->start
51 && $this->stop === $other->stop;
55 * Does this start completely before other? Disjoint.
57 public function startsBeforeDisjoint(Interval $other) : bool
59 return $this->start < $other->start && $this->stop < $other->start;
63 * Does this start at or before other? Nondisjoint.
65 public function startsBeforeNonDisjoint(Interval $other) : bool
67 return $this->start <= $other->start && $this->stop >= $other->start;
71 * Does this.a start after other.b? May or may not be disjoint.
73 public function startsAfter(Interval $other) : bool
75 return $this->start > $other->start;
79 * Does this start completely after other? Disjoint.
81 public function startsAfterDisjoint(Interval $other) : bool
83 return $this->start > $other->stop;
87 * Does this start after other? NonDisjoint
89 public function startsAfterNonDisjoint(Interval $other) : bool
91 // this.b >= other.b implied
92 return $this->start > $other->start && $this->start <= $other->stop;
98 public function disjoint(Interval $other) : bool
100 return $this->startsBeforeDisjoint($other) || $this->startsAfterDisjoint($other);
106 public function adjacent(Interval $other) : bool
108 return $this->start === $other->stop + 1 || $this->stop === $other->start - 1;
112 * Return the interval computed from combining this and other
114 public function union(Interval $other) : self
116 return new self(\min($this->start, $other->start), \max($this->stop, $other->stop));
122 public function intersection(Interval $other) : self
124 return new self(\max($this->start, $other->start), \min($this->stop, $other->stop));