@@ -19,11 +19,21 @@ namespace PolylineAlgorithm.Validation;
19
19
[ DebuggerDisplay ( "{ToString()}" ) ]
20
20
[ StructLayout ( LayoutKind . Sequential , Pack = 8 , Size = 16 ) ]
21
21
public readonly struct CoordinateRange : IEquatable < CoordinateRange > {
22
+ /// <summary>
23
+ /// Creates a new <see cref="CoordinateRange"/> structure that contains <see cref="Min"/>
24
+ /// set to <see cref="double.MinValue"/> and <see cref="Max"/> to <see cref="double.MaxValue"/>.
25
+ /// </summary>
22
26
public CoordinateRange ( ) {
23
27
Min = double . MinValue ;
24
28
Max = double . MaxValue ;
25
29
}
26
30
31
+ /// <summary>
32
+ /// Creates a new <see cref="CoordinateRange"/> structure that contains <see cref="Min"/> and <see cref="Max"/> set to specified values.
33
+ /// </summary>
34
+ /// <param name="min">A minimal allowed value.</param>
35
+ /// <param name="max">A maximal allowed value.</param>
36
+ /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="min" /> argument is greater or equal to <paramref name="max" /> argument.</exception>
27
37
public CoordinateRange ( double min , double max ) {
28
38
if ( min >= max ) {
29
39
throw new ArgumentOutOfRangeException ( nameof ( min ) , string . Format ( ExceptionMessageResource . ArgumentMinCannotBeGreaterOfEqualThanMaxArgumentMessageFormat , min , max ) ) ;
@@ -34,19 +44,19 @@ public CoordinateRange(double min, double max) {
34
44
}
35
45
36
46
/// <summary>
37
- /// Represents inclusive minimal value of the range .
47
+ /// Gets minimal allowed value .
38
48
/// </summary>
39
49
public readonly double Min { get ; }
40
50
41
51
/// <summary>
42
- /// Represents inclusive maximal value of the range .
52
+ /// Gets maximal allowed value .
43
53
/// </summary>
44
54
public readonly double Max { get ; }
45
55
46
56
/// <summary>
47
- /// Indicates whether the <paramref name="value" /> is within the range.
57
+ /// Returns a value indicating whether <see cref="double" /> value is within the allowed range.
48
58
/// </summary>
49
- /// <param name="value">A value to be validated is in range .</param>
59
+ /// <param name="value">The value to be evaluated .</param>
50
60
/// <returns><see langword="true" /> if <paramref name="value"/> is within the range; otherwise, <see langword="false"/>.</returns>
51
61
public bool IsInRange ( double value ) => value >= Min && value <= Max ;
52
62
@@ -78,11 +88,23 @@ public override int GetHashCode() {
78
88
return HashCode . Combine ( Min , Max ) ;
79
89
}
80
90
91
+ /// <summary>
92
+ /// Indicates whether the values of two specified <see cref="CoordinateRange" /> objects are equal.
93
+ /// </summary>
94
+ /// <param name="left">The first object to compare.</param>
95
+ /// <param name="right">The second object to compare.</param>
96
+ /// <returns><see langword="true"/> if <paramref name="left"/> and <paramref name="right"/> are equal; otherwise, <see langword="false"/>.</returns>
81
97
[ ExcludeFromCodeCoverage ]
82
98
public static bool operator == ( CoordinateRange left , CoordinateRange right ) {
83
99
return left . Equals ( right ) ;
84
100
}
85
101
102
+ /// <summary>
103
+ /// Indicates whether the values of two specified <see cref="CoordinateRange" /> objects are not equal.
104
+ /// </summary>
105
+ /// <param name="left">The first object to compare.</param>
106
+ /// <param name="right">The second object to compare.</param>
107
+ /// <returns><see langword="true"/> if <paramref name="left"/> and <paramref name="right"/> are not equal; otherwise, <see langword="false"/>.</returns>
86
108
[ ExcludeFromCodeCoverage ]
87
109
public static bool operator != ( CoordinateRange left , CoordinateRange right ) {
88
110
return ! ( left == right ) ;
0 commit comments