RangeT Structure

Represents a range with lower and upper bounds.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
public readonly struct Range<T> : IEquatable<Range<T>>
where T : Object, IComparable<T>
Inheritance
Object    ValueType    RangeT
Implements
IEquatableRangeT

Type Parameters

T
The type of the range.

Constructors

RangeT(T) Initializes a new instance of the RangeT struct between the default value of T and the specified upperBound.
RangeT(T, T) Initializes a new instance of the RangeT struct between the specified lowerBound and upperBound.

Properties

LowerBound Gets the lower bound of the range.
UpperBound Gets the upper bound of the range. Whether this is an exclusive or inclusive bound, it depends on the context the RangeT is used in.

Methods

Equals(Object) Determines whether the specified Object is equal to this instance.
(Overrides ValueTypeEquals(Object))
Equals(RangeT) Indicates whether the current RangeT instance is equal to another one specified in the other parameter.
GetHashCode Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode)
ToString Gets the string representation of this RangeT instance.
(Overrides ValueTypeToString)

Operators

Equality(RangeT, RangeT) Implements the equality check operator.
(T to RangeT) Performs an implicit conversion from T to RangeT using the provided value as upper bound.
(ValueTupleT, T to RangeT) Performs an implicit conversion from ValueTupleT1, T2 to RangeT.
Inequality(RangeT, RangeT) Implements the inequality check operator.

Extension Methods

Convert Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions)
ConvertTTarget Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions)
In Gets whether item is among the elements of set.
See the Examples section of the generic InT(T, T) overload for an example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)

See Also