IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
IntervalT< T > Class Template Reference

Public Member Functions

 IntervalT (T minimum, T maximum)
 Initializes a new instance of the IntervalT<T> class with specified boundaries.
 
T Clamp (T value)
 Clamps a value to the bounds of this interval.
 
override bool Equals (object? obj)
 Determines whether the specified object is equal to the current interval.
 
override int GetHashCode ()
 Returns a hash code for the current interval.
 
override string ToString ()
 Returns a string representation of the interval.
 

Properties

T Minimum [get]
 Gets the lower boundary of the interval.
 
T Maximum [get]
 Gets the upper boundary of the interval.
 

Detailed Description

Represents an interval consisting of a lower and upper boundary value.

Template Parameters
TThe type of the boundaries. Must be a value type implementing IComparable.
Since
IDSImaging.Peak.Common 1.3
Type Constraints
T :struct 
T :IComparable<T> 

Constructor & Destructor Documentation

◆ IntervalT()

IntervalT ( T minimum,
T maximum )
inline

Initializes a new instance of the IntervalT<T> class with specified boundaries.

Parameters
minimumThe lower boundary.
maximumThe upper boundary.
Exceptions
CommonInvalidParameterExceptionThrown when minimum is greater than maximum .

Member Function Documentation

◆ Clamp()

T Clamp ( T value)
inline

Clamps a value to the bounds of this interval.

Values below the minimum are adjusted to the minimum value, while values above the maximum are adjusted to the maximum value.

Parameters
valueThe value to clamp.
Returns
The clamped value within this interval's boundaries.
Since
IDSImaging.Peak.Common 2.1

◆ Equals()

override bool Equals ( object? obj)
inline

Determines whether the specified object is equal to the current interval.

Parameters
objThe object to compare with the current interval.
Returns
true if the specified object is equal to the current interval; otherwise, false.

◆ GetHashCode()

override int GetHashCode ( )
inline

Returns a hash code for the current interval.

◆ ToString()

override string ToString ( )
inline

Returns a string representation of the interval.

Property Documentation

◆ Maximum

T Maximum
get

Gets the upper boundary of the interval.

◆ Minimum

T Minimum
get

Gets the lower boundary of the interval.