Class PortrayalTimeInterval
A time interval a drawing instruction is valid in: one entry of its
TimeValid list, from a
Date/Time/DateTime command and the TimeValid
command that follows it (S-100 Part 9a §9a-11.2.6).
public sealed record PortrayalTimeInterval : IEquatable<PortrayalTimeInterval>
- Inheritance
-
PortrayalTimeInterval
- Implements
- Inherited Members
Remarks
Bounds are kept as the portrayal emitted them. A missing bound is
unbounded. A date bound may be truncated (S-100 Part 1
S100_TruncatedDate): a periodic range such as ----03-- to
----10-- compares only the month, so it holds from March to the end
of October every year, and one whose begin is later than its end (November
to February) runs over the year end. Times of day wrap over midnight the
same way.
Intervals compare by value, so a host can collect the distinct intervals of a display list cheaply.
Constructors
PortrayalTimeInterval(PortrayalTimeKind, string?, string?, TimeIntervalClosure)
A time interval a drawing instruction is valid in: one entry of its
TimeValid list, from a
Date/Time/DateTime command and the TimeValid
command that follows it (S-100 Part 9a §9a-11.2.6).
public PortrayalTimeInterval(PortrayalTimeKind Kind, string? Begin, string? End, TimeIntervalClosure Closure)
Parameters
KindPortrayalTimeKindWhat the bounds are.
BeginstringThe begin bound as emitted, or null for none.
EndstringThe end bound as emitted, or null for none.
ClosureTimeIntervalClosureWhich bounds apply and whether they're included.
Remarks
Bounds are kept as the portrayal emitted them. A missing bound is
unbounded. A date bound may be truncated (S-100 Part 1
S100_TruncatedDate): a periodic range such as ----03-- to
----10-- compares only the month, so it holds from March to the end
of October every year, and one whose begin is later than its end (November
to February) runs over the year end. Times of day wrap over midnight the
same way.
Intervals compare by value, so a host can collect the distinct intervals of a display list cheaply.
Properties
Begin
The begin bound as emitted, or null for none.
public string? Begin { get; init; }
Property Value
Closure
Which bounds apply and whether they're included.
public TimeIntervalClosure Closure { get; init; }
Property Value
End
The end bound as emitted, or null for none.
public string? End { get; init; }
Property Value
Kind
What the bounds are.
public PortrayalTimeKind Kind { get; init; }
Property Value
Methods
Contains(DateTimeOffset, TimeZoneInfo)
Whether the interval holds at time, with dates read in zone.
public bool Contains(DateTimeOffset time, TimeZoneInfo zone)
Parameters
timeDateTimeOffsetThe instant to test.
zoneTimeZoneInfoThe time zone dates and times of day are read in.
Returns
Overlaps(PortrayalTime)
Whether the interval holds at any time in time: at
its instant, or anywhere in its range.
public bool Overlaps(PortrayalTime time)
Parameters
timePortrayalTimeThe time the map shows.
Returns
TryParseClosure(string?, out TimeIntervalClosure)
Parses a TimeValid closure name (case-insensitive).
public static bool TryParseClosure(string? value, out TimeIntervalClosure closure)
Parameters
valuestringThe name, e.g.
closedInterval.closureTimeIntervalClosureThe closure, when the name is known.