Table of Contents

Class DateRangeIntersect

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

This class that intersects a record with the DateRange(s). The DateRange(s) and each next record in sequence of the tested records have to be Date ordered in the same order, and the ranges must not intersect with each other.

public class DateRangeIntersect
Inheritance
DateRangeIntersect
Inherited Members

Constructors

DateRangeIntersect(DateRangeIntersect)

Initializes a new instance of the DateRangeIntersect class. Copy Constructor.

public DateRangeIntersect(DateRangeIntersect dateRangeIntersect)

Parameters

dateRangeIntersect DateRangeIntersect

The DateRangeIntersect to be copied with the same ranges, but a reset enumerator.

DateRangeIntersect(IEnumerable<IDateRange>)

Initializes a new instance of the DateRangeIntersect class.Constructor.

public DateRangeIntersect(IEnumerable<IDateRange> ranges)

Parameters

ranges IEnumerable<IDateRange>

The Date ASC- ordered sequence of non-intersecting DateRange(s). The DateRange(s) are assumed to be ordered by Date. The best performance is when each record in sequence of the tested records is Date ordered. in the same or opposite order as DateRange(s).

Methods

GetIntersect(in DateTime)

Gets matching DateRange where the record's Date is between the start and end of the range.

public IDateRange? GetIntersect(in DateTime dateTime)

Parameters

dateTime DateTime

The DateTime.

Returns

IDateRange

The matching DateRange or null.

Intersects(in DateTime)

Gets whether a matching DateRange exists where the record's Date is between the start and end of the range.

public bool Intersects(in DateTime dateTime)

Parameters

dateTime DateTime

The DateTime.

Returns

bool

True or False.