Skip to content

Commit d3b9750

Browse files
author
Petr Sramek
committed
updated docs for CoordinateRange struct
1 parent ad26175 commit d3b9750

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/PolylineAlgorithm/Validation/CoordinateRange.cs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,21 @@ namespace PolylineAlgorithm.Validation;
1919
[DebuggerDisplay("{ToString()}")]
2020
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 16)]
2121
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>
2226
public CoordinateRange() {
2327
Min = double.MinValue;
2428
Max = double.MaxValue;
2529
}
2630

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>
2737
public CoordinateRange(double min, double max) {
2838
if (min >= max) {
2939
throw new ArgumentOutOfRangeException(nameof(min), string.Format(ExceptionMessageResource.ArgumentMinCannotBeGreaterOfEqualThanMaxArgumentMessageFormat, min, max));
@@ -34,19 +44,19 @@ public CoordinateRange(double min, double max) {
3444
}
3545

3646
/// <summary>
37-
/// Represents inclusive minimal value of the range.
47+
/// Gets minimal allowed value.
3848
/// </summary>
3949
public readonly double Min { get; }
4050

4151
/// <summary>
42-
/// Represents inclusive maximal value of the range.
52+
/// Gets maximal allowed value.
4353
/// </summary>
4454
public readonly double Max { get; }
4555

4656
/// <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.
4858
/// </summary>
49-
/// <param name="value">A value to be validated is in range.</param>
59+
/// <param name="value">The value to be evaluated.</param>
5060
/// <returns><see langword="true" /> if <paramref name="value"/> is within the range; otherwise, <see langword="false"/>.</returns>
5161
public bool IsInRange(double value) => value >= Min && value <= Max;
5262

@@ -78,11 +88,23 @@ public override int GetHashCode() {
7888
return HashCode.Combine(Min, Max);
7989
}
8090

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>
8197
[ExcludeFromCodeCoverage]
8298
public static bool operator ==(CoordinateRange left, CoordinateRange right) {
8399
return left.Equals(right);
84100
}
85101

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>
86108
[ExcludeFromCodeCoverage]
87109
public static bool operator !=(CoordinateRange left, CoordinateRange right) {
88110
return !(left == right);

0 commit comments

Comments
 (0)