Table of Contents

Class OpenInterval<T>

Namespace
Garyon.Objects
Assembly
Garyon.dll

Represents an open interval to the one direction from a given value.

public record OpenInterval<T> : IEquatable<OpenInterval<T>> where T : IComparable<T>

Type Parameters

T

The type of the reference value for the open interval.

Inheritance
OpenInterval<T>
Implements
Inherited Members
Extension Methods

Constructors

OpenInterval(T, ComparisonKinds)

Represents an open interval to the one direction from a given value.

public OpenInterval(T Value, ComparisonKinds ComparisonKinds)

Parameters

Value T

The open interval's reference value.

ComparisonKinds ComparisonKinds

The comparison kinds representing the direction of the open interval. It is applied to the left side of the reference value, for instance >= 4.

Properties

ComparisonKinds

The comparison kinds representing the direction of the open interval. It is applied to the left side of the reference value, for instance >= 4.

public ComparisonKinds ComparisonKinds { get; init; }

Property Value

ComparisonKinds

Value

The open interval's reference value.

public T Value { get; init; }

Property Value

T

Methods

Contains(T)

Determines whether a value is contained in this open interval.

public bool Contains(T other)

Parameters

other T

The other value to compare against this open interval.

Returns

bool

true if the value is contained in the open interval, meaning that other [comparison] Value is true, otherwise false.

Operators

implicit operator OpenInterval<T>(T)

Converts a value into an OpenInterval<T>, considering the open interval as the single value interval, ranging between the same value.

public static implicit operator OpenInterval<T>(T value)

Parameters

value T

The reference value of the open interval.

Returns

OpenInterval<T>