Struct TimeInterval<T>
Represents a value associated with time interval information. The time interval can represent the time it took to produce the value, the interval relative to a previous value, the value's delivery time relative to a base, etc.
Implements
Inherited Members
Namespace: System.Reactive
Assembly: System.Reactive.Linq.dll
Syntax
[Serializable]
public struct TimeInterval<T> : IEquatable<TimeInterval<T>>
Type Parameters
Name | Description |
---|---|
T | The type of the value being annotated with time interval information. |
Constructors
| Improve this Doc View SourceTimeInterval(T, TimeSpan)
Constructs a time interval value.
Declaration
public TimeInterval(T value, TimeSpan interval)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to be annotated with a time interval. |
TimeSpan | interval | Time interval associated with the value. |
Properties
| Improve this Doc View SourceInterval
Gets the interval.
Declaration
public TimeSpan Interval { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Value
Gets the value.
Declaration
public T Value { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether the specified System.Object is equal to the current TimeInterval<T>.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The System.Object to compare with the current TimeInterval<T>. |
Returns
Type | Description |
---|---|
Boolean | true if the specified System.Object is equal to the current TimeInterval<T>; otherwise, false. |
Overrides
| Improve this Doc View SourceEquals(TimeInterval<T>)
Determines whether the current TimeInterval<T> value has the same Value and Interval as a specified TimeInterval<T> value.
Declaration
public bool Equals(TimeInterval<T> other)
Parameters
Type | Name | Description |
---|---|---|
TimeInterval<T> | other | An object to compare to the current TimeInterval<T> value. |
Returns
Type | Description |
---|---|
Boolean | true if both TimeInterval<T> values have the same Value and Interval; otherwise, false. |
GetHashCode()
Returns the hash code for the current TimeInterval<T> value.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for the current TimeInterval<T> value. |
Overrides
| Improve this Doc View SourceToString()
Returns a string representation of the current TimeInterval<T> value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | String representation of the current TimeInterval<T> value. |
Overrides
Operators
| Improve this Doc View SourceEquality(TimeInterval<T>, TimeInterval<T>)
Determines whether the two specified TimeInterval<T> values have the same Value and Interval.
Declaration
public static bool operator ==(TimeInterval<T> first, TimeInterval<T> second)
Parameters
Type | Name | Description |
---|---|---|
TimeInterval<T> | first | The first TimeInterval<T> value to compare. |
TimeInterval<T> | second | The second TimeInterval<T> value to compare. |
Returns
Type | Description |
---|---|
Boolean | true if the first TimeInterval<T> value has the same Value and Interval as the second TimeInterval<T> value; otherwise, false. |
Inequality(TimeInterval<T>, TimeInterval<T>)
Determines whether the two specified TimeInterval<T> values don't have the same Value and Interval.
Declaration
public static bool operator !=(TimeInterval<T> first, TimeInterval<T> second)
Parameters
Type | Name | Description |
---|---|---|
TimeInterval<T> | first | The first TimeInterval<T> value to compare. |
TimeInterval<T> | second | The second TimeInterval<T> value to compare. |
Returns
Type | Description |
---|---|
Boolean | true if the first TimeInterval<T> value has a different Value or Interval as the second TimeInterval<T> value; otherwise, false. |