Class TimeRange
Structure representing a time range
Inheritance
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public sealed class TimeRange : ValueType
Constructors
TimeRange(Int64, Int64)
Initialises a new instance of the Time
Declaration
public TimeRange(long startTime, long endTime)
Parameters
Type | Name | Description |
---|---|---|
System. |
startTime | The start time. |
System. |
endTime | The end time. |
Properties
EndTime
Gets the end time.
Declaration
public long EndTime { get; }
Property Value
Type | Description |
---|---|
System. |
Span
Gets the length of the time range
Declaration
public long Span { get; }
Property Value
Type | Description |
---|---|
System. |
StartTime
Gets the start time.
Declaration
public long StartTime { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
Contains(Int64)
Returns true if the timestamp lies within the current time range
Declaration
public bool Contains(long timestamp)
Parameters
Type | Name | Description |
---|---|---|
System. |
timestamp | The timestamp. |
Returns
Type | Description |
---|---|
System. |
|
Equals(Object)
Determines whether the specified System.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System. |
obj | The System. |
Returns
Type | Description |
---|---|
System. |
Returns |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System. |
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Matches(Nullable<TimeRange>)
Returns true if the time range exactly matches the passed start and end time
Declaration
public bool Matches(Nullable<TimeRange> timeRange)
Parameters
Type | Name | Description |
---|---|---|
System. |
timeRange | The time range. |
Returns
Type | Description |
---|---|
System. |
True if matches, otherwise false |
Overlaps(TimeRange)
Returns true if the passed time range overlaps in time with the current instance.
Declaration
public bool Overlaps(TimeRange timeRange)
Parameters
Type | Name | Description |
---|---|---|
Time |
timeRange | The time range. |
Returns
Type | Description |
---|---|
System. |
True if overlaps, otherwise false |
ToString()
Returns a System.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |
A System. |