NewInterval creates an interval from two bounds. Silently changes Start to NegativeInfinity and End to PositiveInfinity in case invalid bounds are passed.
(start, end TemporalBound)
| 326 | // Silently changes Start to NegativeInfinity |
| 327 | // and End to PositiveInfinity in case invalid bounds are passed. |
| 328 | func NewInterval(start, end TemporalBound) Interval { |
| 329 | if start.Type == PositiveInfinityBound { |
| 330 | start = NegativeInfinity() |
| 331 | } |
| 332 | if end.Type == NegativeInfinityBound { |
| 333 | end = PositiveInfinity() |
| 334 | } |
| 335 | return Interval{Start: start, End: end} |
| 336 | } |
| 337 | |
| 338 | // NewPointInterval creates an interval representing a single point in time. |
| 339 | func NewPointInterval(t time.Time) Interval { |