Tuple<T1> 类
定义
表示 1 元组,或单元组。Represents a 1-tuple, or singleton.
generic <typename T1>
public ref class Tuple : IComparable, System::Collections::IStructuralComparable, System::Collections::IStructuralEquatable
generic <typename T1>
public ref class Tuple : IComparable, System::Collections::IStructuralComparable, System::Collections::IStructuralEquatable, System::Runtime::CompilerServices::ITuple
public class Tuple<T1> : IComparable, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
public class Tuple<T1> : IComparable, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.Runtime.CompilerServices.ITuple
[System.Serializable]
public class Tuple<T1> : IComparable, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
type Tuple<'T1> = class
interface IStructuralComparable
interface IStructuralEquatable
interface IComparable
type Tuple<'T1> = class
interface IStructuralComparable
interface IStructuralEquatable
interface IComparable
interface ITuple
[<System.Serializable>]
type Tuple<'T1> = class
interface IStructuralEquatable
interface IStructuralComparable
interface IComparable
[<System.Serializable>]
type Tuple<'T1> = class
interface IStructuralEquatable
interface IStructuralComparable
interface IComparable
interface ITuple
Public Class Tuple(Of T1)
Implements IComparable, IStructuralComparable, IStructuralEquatable
Public Class Tuple(Of T1)
Implements IComparable, IStructuralComparable, IStructuralEquatable, ITuple
类型参数
- T1
元组的唯一一个分量的类型。The type of the tuple's only component.
- 继承
-
Tuple<T1>
- 属性
- 实现
注解
元组是具有特定数量和值序列的数据结构。A tuple is a data structure that has a specific number and sequence of values. Tuple<T1>类表示1元组,即单一实例,它是具有单个组件的元组。The Tuple<T1> class represents a 1-tuple, or singleton, which is a tuple that has a single component. 在应用程序开发中,单一实例相对很少使用。A singleton is used comparatively rarely in application development.
可以 Tuple<T1> 通过调用 Tuple<T1> 构造函数或静态方法来实例化对象 Tuple.Create 。You can instantiate a Tuple<T1> object by calling either the Tuple<T1> constructor or the static Tuple.Create method. 您可以使用只读实例属性检索元组的单个组件的值 Item1 。You can retrieve the value of the tuple's single component by using the read-only Item1 instance property.
构造函数
Tuple<T1>(T1) |
初始化 Tuple<T1> 类的新实例。Initializes a new instance of the Tuple<T1> class. |
属性
Item1 |
获取 Tuple<T1> 对象的单一分量的值。Gets the value of the Tuple<T1> object's single component. |
方法
Equals(Object) |
返回一个值,该值指示当前的 Tuple<T1> 对象是否与指定对象相等。Returns a value that indicates whether the current Tuple<T1> object is equal to a specified object. |
GetHashCode() |
返回当前 Tuple<T1> 对象的哈希代码。Returns the hash code for the current Tuple<T1> object. |
GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
ToString() |
返回表示此 Tuple<T1> 实例的值的字符串。Returns a string that represents the value of this Tuple<T1> instance. |
显式接口实现
IComparable.CompareTo(Object) |
将当前 Tuple<T1> 对象与指定对象进行比较,并返回一个整数,该整数指示当前对象在排序顺序中的位置是位于指定对象之前、之后还是与其位置相同。Compares the current Tuple<T1> object to a specified object, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. |
IStructuralComparable.CompareTo(Object, IComparer) |
使用指定的比较器将当前的 Tuple<T1> 对象与指定对象进行比较,并返回一个整数,该整数指示当前对象在排序顺序中的位置是在指定对象之前、之后还是与其相同。Compares the current Tuple<T1> object to a specified object by using a specified comparer, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. |
IStructuralEquatable.Equals(Object, IEqualityComparer) |
返回一个值,该值根据指定的比较方法指示当前的 Tuple<T1> 对象是否与指定对象相等。Returns a value that indicates whether the current Tuple<T1> object is equal to a specified object based on a specified comparison method. |
IStructuralEquatable.GetHashCode(IEqualityComparer) |
使用指定的计算方法计算当前 Tuple<T1> 对象的哈希代码。Calculates the hash code for the current Tuple<T1> object by using a specified computation method. |
ITuple.Item[Int32] |
获取 |
ITuple.Length |
获取 |
扩展方法
Deconstruct<T1>(Tuple<T1>, T1) |
将具有 1 个元素的元组解构为不同的变量。Deconstructs a tuple with 1 element into a separate variable. |
ToValueTuple<T1>(Tuple<T1>) |
将 |