Specifies a range of one or more days e.g. 2020-01-01 to 2020-12-31.
Inheritance Hierarchy Namespace: DegreeDays.TimeAssembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntaxpublic struct DayRange : IEquatable<DayRange>,
IEnumerable<Day>, IEnumerable
Public Structure DayRange
Implements IEquatable(Of DayRange), IEnumerable(Of Day),
IEnumerable
The DayRange type exposes the following members.
Constructors | Name | Description |
---|
 | DayRange |
Constructs a DayRange that starts on the specified
first day and ends on the specified last day.
|
Top
Properties | Name | Description |
---|
 | Count |
Gets the number of days covered by this DayRange (always
1 or more).
|
 | First |
Gets the first Day in this DayRange.
|
 | Item |
Gets the Day at the specified zero-based index
within this DayRange.
|
 | Last |
Gets the last Day in this DayRange.
|
Top
Methods | Name | Description |
---|
 | Contains(Day) |
Returns true if the specified Day is
contained within this DayRange; false otherwise.
|
 | Contains(DayRange) |
Returns true if the specified DayRange is fully
contained within this DayRange; false
otherwise.
|
 | Equals(DayRange) |
Returns true if other covers exactly the same days as this DayRange;
false otherwise.
|
 | Equals(Object) |
Returns true if obj is a DayRange that covers exactly
the same days as this DayRange; false otherwise.
(Overrides ValueTypeEquals(Object)) |
 | GetEnumerator |
Returns an enumerator for iterating over each Day contained within
this DayRange.
|
 | GetHashCode |
Overridden to ensure consistency with Equals.
(Overrides ValueTypeGetHashCode) |
 | GreedyUnion(Day) |
Returns the DayRange that includes all the days
within this DayRange, the specified Day
(dayToIncludeInUnion), and any days between.
|
 | GreedyUnion(DayRange) |
Returns the DayRange that includes all the days
within this DayRange, the specified DayRange
(rangeToIncludeInUnion), and any days between.
|
 | IndexOf |
Returns the index of the specified Day within this
DayRange, or -1 if it is not contained within this
DayRange.
|
 | Intersection |
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.
|
 | ToString |
Returns a non-null, non-empty string representation of this instance for logging and debugging purposes.
(Overrides ValueTypeToString) |
Top
Operators
Thread Safety
Instances of this struct are immutable and safe for use from multiple threads at once.
See Also