HalfOpenInterval

struct HalfOpenInterval<T : Comparable>

A half-open IntervalType, which contains its start but not its end. Can 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: HalfOpenInterval<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.

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: HalfOpenInterval<T>) -> HalfOpenInterval<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