IntervalType

An interval over a Comparable type.

Inheritance View Protocol Hierarchy →
Associated Types

The type of the Interval's endpoints.

Import
  • import Swift

Instance Variables

var end: Self.Bound Required

The Interval's upper bound.

Invariant: start <= end.

Declaration

  • var end: Self.Bound { get }
var isEmpty: Bool Required

true iff self is empty.

Declaration

  • var isEmpty: Bool { get }
var start: Self.Bound Required

The Interval's lower bound.

Invariant: start <= end.

Declaration

  • var start: Self.Bound { get }

Instance Methods

func clamp(_:) Required

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
func contains(_:) Required

Returns true iff the interval contains value.

Declaration

  • func contains(value: Self.Bound) -> Bool

Default Implementations

func overlaps(_:)

Returns true if lhs and rhs have a non-empty intersection.

Declaration