Click or drag to resize

DayRange Structure

Specifies a range of one or more days e.g. 2020-01-01 to 2020-12-31.
Inheritance Hierarchy
SystemObject
  SystemValueType
    DegreeDays.TimeDayRange

Namespace: DegreeDays.Time
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public struct DayRange : IEquatable<DayRange>, 
	IEnumerable<Day>, IEnumerable

The DayRange type exposes the following members.

Constructors
 NameDescription
Public methodDayRange Constructs a DayRange that starts on the specified first day and ends on the specified last day.
Top
Properties
 NameDescription
Public propertyCount Gets the number of days covered by this DayRange (always 1 or more).
Public propertyFirst Gets the first Day in this DayRange.
Public propertyItem Gets the Day at the specified zero-based index within this DayRange.
Public propertyLast Gets the last Day in this DayRange.
Top
Methods
 NameDescription
Public methodContains(Day) Returns true if the specified Day is contained within this DayRange; false otherwise.
Public methodContains(DayRange) Returns true if the specified DayRange is fully contained within this DayRange; false otherwise.
Public methodEquals(DayRange) Returns true if other covers exactly the same days as this DayRange; false otherwise.
Public methodEquals(Object) Returns true if obj is a DayRange that covers exactly the same days as this DayRange; false otherwise.
(Overrides ValueTypeEquals(Object))
Public methodGetEnumerator Returns an enumerator for iterating over each Day contained within this DayRange.
Public methodGetHashCode Overridden to ensure consistency with Equals.
(Overrides ValueTypeGetHashCode)
Public methodGreedyUnion(Day) Returns the DayRange that includes all the days within this DayRange, the specified Day (dayToIncludeInUnion), and any days between.
Public methodGreedyUnion(DayRange) Returns the DayRange that includes all the days within this DayRange, the specified DayRange (rangeToIncludeInUnion), and any days between.
Public methodIndexOf Returns the index of the specified Day within this DayRange, or -1 if it is not contained within this DayRange.
Public methodIntersection Returns a DayRange covering the days that are contained within both this DayRange and the specified DayRange, or null if there is no such intersection.
Public methodToString Returns a non-null, non-empty string representation of this instance for logging and debugging purposes.
(Overrides ValueTypeToString)
Top
Operators
 NameDescription
Public operatorStatic memberEquality(DayRange, DayRange) Determines whether two specified DayRange instances are equal.
Public operatorStatic memberInequality(DayRange, DayRange) Determines whether two specified DayRange instances are not equal.
Top
Thread Safety
Instances of this struct are immutable and safe for use from multiple threads at once.
See Also