Returns true if the given range is partially contained
within this range.
Namespace: InnerDrive.CoreAssembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.0.8475.0
Syntax bool Overlaps(
IRange<T>? value
)
Parameters
- value IRangeT
- The range to compare with this range.
Return Value
Booleantrue if the range is partially contained within this range.
Remarks
A range overlaps another range when the any part of one range is contained
within the other.
Range A | Range B | A.Overlaps(B)? |
---|
23456 | 012 | * |
23456 | 123 | true |
23456 | 23456 | true |
23456 | 567 | true |
23456 | 678 | * |
23456 | 789 | false |
* The behavior of Overlaps depends on whether the ranges are inclusive. Also,
the results of RangeA.Overlaps(RangeB) and RangeB.Overlaps(RangeA) must always return
the same value. Therefore, the following shows the behavior of two adjacent ranges. Assume
RangeA = { 3, 4, 5 } and RangeB = { 5, 6, 7 }.
Orthogonal ranges always overlap, regardless of their IsLowerInclusive and
IsUpperInclusive values.
See Also