Skip to content

Izayoi.Data.TimestampedObjects.ComparableTimestampedStruct

IzayoiJiichan edited this page Feb 1, 2025 · 1 revision

ComparableTimestampedStruct<TValue>

Definition

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

Represents a comparable timestamped structure that can be assigned comparable structure.

public readonly struct ComparableTimestampedStruct<TValue> :
    IComparableTimestampedStruct<TValue>,
    IComparable<ComparableTimestampedStruct<TValue>>,
    IEquatable<ComparableTimestampedStruct<TValue>>
    where TValue : struct, IComparable<TValue>, IEquatable<TValue>

Type Parameters

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

IComparable<TVable>
IEquatable<TVable>

Inheritance

Object -> ValueType -> ComparableTimestampedStruct<TValue>

Constructors

Name Summary
ComparableTimestampedStruct<TValue>(in long timestamp, in TValue value) Initializes an instance of the ComparableTimestampedStruct<TValue> structure to the specified timestamp and value.
ComparableTimestampedStruct<TValue>(in TValue value) Initializes an instance of the ComparableTimestampedStruct<TValue> structure 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(ComparableTimestampedStruct<TValue> other) int Compares this instance to a specified ComparableTimestampedStruct<TValue> and returns an indication of their relative values.
CompareTo(IComparableTimestampedStruct<TValue>? other) int Compares this instance to a specified IComparableTimestampedStruct<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 ComparableTimestampedStruct<TValue> instance by timestamp and value.
Equals(ComparableTimestampedStruct<TValue> other) bool Indicates whether the current ComparableTimestampedStruct<TValue> object is equal to a specified ComparableTimestampedStruct<TValue>.
Equals(IComparableTimestampedStruct<TValue>? other) bool Indicates whether the current ComparableTimestampedStruct<TValue> object is equal to a specified IComparableTimestampedStruct<TValue>.
Equals(object? other) bool Indicates whether the current ComparableTimestampedStruct<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 ComparableTimestampedStruct<TValue> object.

Operators

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

Examples

Example.ComparableTimestampedStruct

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