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 TimeRange struct.
Declaration
public TimeRange(long startTime, long endTime)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | startTime | The start time. |
System.Int64 | endTime | The end time. |
Properties
EndTime
Gets the end time.
Declaration
public long EndTime { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Span
Gets the length of the time range
Declaration
public long Span { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
StartTime
Gets the start time.
Declaration
public long StartTime { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
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.Int64 | timestamp | The timestamp. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | 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.Nullable<TimeRange> | timeRange | The time range. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
TimeRange | timeRange | The time range. |
Returns
Type | Description |
---|---|
System.Boolean | True if overlaps, otherwise false |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |