ClosedInterval

struct ClosedInterval<T : Comparable>

A closed IntervalType, which contains both its start and its end. Cannot represent an empty interval.

Inheritance DebugPrintable, Equatable, IntervalType, Printable, Reflectable View Protocol Hierarchy →
Associated Types
Bound = T

The type of the Interval's endpoints

Import import Swift

Initializers

init(_:)

Construct a copy of x

Declaration

init(_ x: ClosedInterval<T>)
init(_:_:)

Construct an interval with the given bounds. Requires: start <= end.

Declaration

init(_ start: T, _ end: T)

Instance Variables

var debugDescription: String

A textual representation of self, suitable for debugging.

Declaration

var debugDescription: String { get }
var description: String

A textual representation of self.

Declaration

var description: String { get }
var end: T

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

Declaration

var end: T { get }
var isEmpty: Bool

true iff the Interval is empty. In the case of ClosedInterval, always returns false

Declaration

var isEmpty: Bool { get }
var start: T

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

Declaration

var start: T { get }

Instance Methods

func clamp(_:)

Return intervalToClamp clamped to self. The bounds of the result, even if it is empty, are always limited to the bounds of self

Declaration

func clamp(intervalToClamp: ClosedInterval<T>) -> ClosedInterval<T>
func contains(_:)

Returns true iff the Interval contains x

Declaration

func contains(x: T) -> Bool
func getMirror()

Returns a mirror that reflects self.

Declaration

func getMirror() -> MirrorType