HalfOpenInterval

A half-open Interval, which contains its start but not its end. Can represent an empty interval.

Bound: The type of the endpoints.

Inheritance CustomDebugStringConvertible, CustomPlaygroundQuickLookable, CustomReflectable, CustomStringConvertible, Equatable, Interval View Protocol Hierarchy →
Import
  • import Swift

Initializers

init(_:)

Construct a copy of x.

Declaration

  • init(_ x: HalfOpenInterval<Bound>)

Instance Variables

var customMirror: Mirror

Returns a mirror that reflects self.

Declaration

  • var customMirror: Mirror { get }
var customPlaygroundQuickLook: PlaygroundQuickLook

Declaration

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

The Interval's upper bound.

Invariant: start <= end.

Declaration

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

true iff the Interval is empty.

Declaration

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

The Interval's lower bound.

Invariant: start <= end.

Declaration

  • var start: Bound { get }

Instance Methods

func clamp(_:)

Returns 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<Bound>) -> HalfOpenInterval<Bound>
func contains(_:)

Returns true iff the Interval contains x.

Declaration

  • func contains(x: Bound) -> Bool
func overlaps(_:)

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

Declaration

  • func overlaps<I : Interval where I.Bound == Bound>(other: I) -> Bool

Declared In

Interval

1 inherited item hidden. (Show all)