protocol IntervalType
Inheritance | View Protocol Hierarchy → |
---|---|
Associated Types | |
Import | import Swift |
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
Returns 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
Returns true
iff the interval contains value
.
Declaration
func contains(value: Self.Bound) -> Bool
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.