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: Bound Required

The Interval's upper bound. Invariant: start <= end

Declaration

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

True iff self is empty

Declaration

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

The Interval's lower bound. Invariant: start <= end

Declaration

  • var start: Bound { get }

Instance Methods

func clamp(_:) Required

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

Returns true iff the interval contains value

Declaration

  • func contains(value: Bound) -> Bool