Skip to content

Izayoi.Data.TimestampedObjects.ComparableTimestampedObject

IzayoiJiichan edited this page Feb 1, 2025 · 1 revision

ComparableTimestampedObject<TValue>

Definition

Namespace Izayoi.Data.TimestampedObjects
Assembly Izayoi.Data.TimestampedObjects.dll

Represents a comparable timestamped class that can be assigned comparable object.

public class ComparableTimestampedObject<TValue> :
    IComparableTimestampedObject<TValue>,
    IComparable<ComparableTimestampedObject<TValue>>,
    IEquatable<ComparableTimestampedObject<TValue>>
    where TValue : IComparable<TValue>, IEquatable<TValue>

Type Parameters

TValue
The underlying value type of the ComparableTimestampedObject<TValue> generic type.

IComparable<TVable>
IEquatable<TVable>

Inheritance

Object -> ValueType -> ComparableTimestampedObject<TValue>

Constructors

Name Summary
ComparableTimestampedObject<TValue>() Initializes an instance of the ComparableTimestampedObject<TValue> class.
ComparableTimestampedObject<TValue>(in long timestamp, in TValue? value) Initializes an instance of the ComparableTimestampedObject<TValue> class to the specified timestamp and value.
ComparableTimestampedObject<TValue>(in TValue? value) Initializes an instance of the ComparableTimestampedObject<TValue> class to the specified value.

Properties

Name Type Summary
Timestamp long Gets Unix timestamp milliseconds.
Value TValue? Gets the value of the current object if it has been assigned a valid underlying value.

Methods

Name Returns Summary
CompareTo(ComparableTimestampedObject<TValue>? other) int Compares this instance to a specified ComparableTimestampedObject<TValue> and returns an indication of their relative values.
CompareTo(IComparableTimestampedObject<TValue>? other) int Compares this instance to a specified IComparableTimestampedObject<TValue> and returns an indication of their relative values.
CompareTo(object? other) int Compares this instance to a specified object and returns an indication of their relative values.
Deconstruct(out long timestamp, out TValue value) void Deconstructs this ComparableTimestampedObject<TValue> instance by timestamp and value.
Equals(ComparableTimestampedObject<TValue>? other) bool Indicates whether the current ComparableTimestampedObject<TValue> object is equal to a specified ComparableTimestampedObject<TValue>.
Equals(IComparableTimestampedObject<TValue>? other) bool Indicates whether the current ComparableTimestampedObject<TValue> object is equal to a specified IComparableTimestampedObject<TValue>.
Equals(object? other) bool Indicates whether the current ComparableTimestampedObject<TValue> object is equal to a specified object.
GetHashCode() string Returns the hash code for this instance.
ToString() string? Returns the text representation of the value of the current ComparableTimestampedObject<TValue> object.

Operators

Operator Returns Left Right
== bool ComparableTimestampedObject<TValue> ComparableTimestampedObject<TValue>
!= bool ComparableTimestampedObject<TValue> ComparableTimestampedObject<TValue>
< bool ComparableTimestampedObject<TValue> ComparableTimestampedObject<TValue>
<= bool ComparableTimestampedObject<TValue> ComparableTimestampedObject<TValue>
> bool ComparableTimestampedObject<TValue> ComparableTimestampedObject<TValue>
>= bool ComparableTimestampedObject<TValue> ComparableTimestampedObject<TValue>

Remarks

The order of comparison is Timestamp first, Value second.

Applies to

Product Versions
.NET 8, 9
.NET Standard 2.0, 2.1
Clone this wiki locally