protocol
IntervalType
Inheritance | View Protocol Hierarchy → |
---|---|
Associated Types |
The type of the |
Import |
|
Instance Variables
The Interval
's upper bound.
Invariant: start
<= end
.
Declaration
var
end
:
Self
.
Bound
{
get
}
The Interval
's lower bound.
Invariant: start
<= end
.
Declaration
var
start
:
Self
.
Bound
{
get
}
Instance Methods
Return rhs
clamped to self
. The bounds of the result, even
if it is empty, are always within the bounds of self
.
Declaration
func
clamp
(
intervalToClamp
:
Self
) -
>
Self
Default Implementations
Returns true
if lhs
and rhs
have a non-empty intersection.
Declaration
func
overlaps
<
I
:
IntervalType
where
I
.
Bound
==
Bound
>
(
other
:
I
) -
>
Bool
An interval over a
Comparable
type.