Class Indexed<T>
Represents an object that has an associated index value. The interpretation of the index is contextual and extrinsic to the object.
Inheritance
Implements
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public sealed class Indexed<T> : ValueType, IEquatable<Indexed<T>>
Type Parameters
| Name | Description |
|---|---|
| T | Type of the object to associate with an index. |
Constructors
Indexed(T, Int32)
Creates a new indexed object association.
Declaration
public Indexed(T value, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | Object to associate with the index. |
| System.Int32 | index | Index to associate the object with. |
Properties
Index
Gets the index the object is associated with.
Declaration
public int Index { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Value
Gets the object associated with the index.
Declaration
public T Value { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
Equals(Indexed<T>)
Determines whether this value equals to the specified indexed value. Two indexed values matches if both their index and object are equal.
Declaration
public bool Equals(Indexed<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| Indexed<T> | other | Other indexed value to compare this value to. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if both indexed values are equal; otherwise, false. |
Equals(Object)
Determines whether this value is equal to the specified object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | Object to compare this value to. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if this value equals the specified object; otherwise, false. |
GetHashCode()
Gets a hash code representation of this value.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | Hash code representation of this value. |
ToString()
Gets the string representation of the indexed value.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | String representation of the indexed value. |
Operators
Equality(Indexed<T>, Indexed<T>)
Determines whether the specified indexed values are equal. Two indexed values matches if both their index and object are equal.
Declaration
public static bool operator ==(Indexed<T> objA, Indexed<T> objB)
Parameters
| Type | Name | Description |
|---|---|---|
| Indexed<T> | objA | First indexed value to compare. |
| Indexed<T> | objB | Second indexed value to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if both indexed values are equal; otherwise, false. |
Inequality(Indexed<T>, Indexed<T>)
Determines whether the specified indexed values are not equal. Two indexed values matches if both their index and object are equal.
Declaration
public static bool operator !=(Indexed<T> objA, Indexed<T> objB)
Parameters
| Type | Name | Description |
|---|---|---|
| Indexed<T> | objA | First indexed value to compare. |
| Indexed<T> | objB | Second indexed value to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if both indexed values are not equal; otherwise, false. |