1 | <?php |
||
16 | class IntervalComparator |
||
17 | { |
||
18 | /** |
||
19 | * @var ComparableIntervalInterface |
||
20 | */ |
||
21 | private $interval; |
||
22 | |||
23 | /** |
||
24 | * @param ComparableIntervalInterface $interval |
||
25 | */ |
||
26 | public function __construct(ComparableIntervalInterface $interval) |
||
30 | |||
31 | /** |
||
32 | * @param ComparableIntervalInterface $interval |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function equal(ComparableIntervalInterface $interval) |
||
44 | |||
45 | /** |
||
46 | * @param IntervalPointInterface $point |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function contains(IntervalPointInterface $point) |
||
62 | |||
63 | /** |
||
64 | * @param ComparableIntervalInterface $interval |
||
65 | * @param bool $check_interval_type |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function intersects(ComparableIntervalInterface $interval, $check_interval_type = true) |
||
90 | |||
91 | /** |
||
92 | * @param ComparableIntervalInterface $interval |
||
93 | * |
||
94 | * @return ComparableIntervalInterface|null |
||
95 | */ |
||
96 | public function intersection(ComparableIntervalInterface $interval) |
||
139 | |||
140 | /** |
||
141 | * The point is before the interval. |
||
142 | * |
||
143 | * @param IntervalPointInterface $point |
||
144 | * |
||
145 | * @return bool |
||
146 | */ |
||
147 | public function before(IntervalPointInterface $point) |
||
151 | |||
152 | /** |
||
153 | * The point is after the interval. |
||
154 | * |
||
155 | * @param IntervalPointInterface $point |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | public function after(IntervalPointInterface $point) |
||
163 | } |
||
164 |