Show / Hide Table of Contents

Class TimeRange

Implementation of ITimeRange

Inheritance
System.Object
TimeRange
Implements
System.IEquatable<TimeRange>
Namespace: MAT.Atlas.Api.Core.Data
Assembly: MAT.Atlas.Api.Core.dll
Syntax
public sealed class TimeRange : ValueType, IEquatable<TimeRange>

Constructors

TimeRange(Int64, Int64)

Instantiate a time range with start and end values.

Declaration
public TimeRange(long start, long end)
Parameters
Type Name Description
System.Int64 start

The start value.

System.Int64 end

The end value.

Properties

End

End Timestamp

Declaration
public long End { get; }
Property Value
Type Description
System.Int64

Length

Gets the length of the range.

Declaration
public long Length { get; }
Property Value
Type Description
System.Int64

The range length.

Start

Start Timestamp

Declaration
public long Start { get; }
Property Value
Type Description
System.Int64

Methods

Equals(TimeRange)

Indicates whether this instance and a specified other object of the same type are equal.

Declaration
public bool Equals(TimeRange other)
Parameters
Type Name Description
TimeRange other

The other TimeRange to compare with the current instance.

Returns
Type Description
System.Boolean

true if other and this instance represent the same value; false otherwise

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

true if the specified System.Object is equal to this instance; otherwise, false.

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.

IsWithinRange(Int64)

Checks the specified timestamp is in the current range.

Declaration
public bool IsWithinRange(long timestamp)
Parameters
Type Name Description
System.Int64 timestamp

The timestamp.

Returns
Type Description
System.Boolean

true if in current range, otherwise false.

Operators

Equality(TimeRange, TimeRange)

Indicates whether two instances of the same type represent the same value.

Declaration
public static bool operator ==(TimeRange left, TimeRange right)
Parameters
Type Name Description
TimeRange left

The TimeRange on the left-hand side of the expression

TimeRange right

The TimeRange on the right-hand side of the expression

Returns
Type Description
System.Boolean

true if left and right represent the same value; false otherwise

Inequality(TimeRange, TimeRange)

Indicates whether two instances of the same type do not represent the same value.

Declaration
public static bool operator !=(TimeRange left, TimeRange right)
Parameters
Type Name Description
TimeRange left

The TimeRange on the left-hand side of the expression

TimeRange right

The TimeRange on the right-hand side of the expression

Returns
Type Description
System.Boolean

true if left and right do not represent the same value; false otherwise

Implements

System.IEquatable<>

Extension Methods

TimeRangeExtensions.IsGreaterThan(TimeRange, Int64)
TimeRangeExtensions.IsValid(TimeRange)
In This Article
Back to top Generated by DocFX