Tuple 类

Represents an ordered collection of members from different hierarchies.

继承层次结构

System. . :: . .Object
  Microsoft.AnalysisServices.AdomdClient..::..Tuple

命名空间:  Microsoft.AnalysisServices.AdomdClient
程序集:  Microsoft.AnalysisServices.AdomdClient(在 Microsoft.AnalysisServices.AdomdClient.dll 中)

语法

声明
Public NotInheritable Class Tuple
用法
Dim instance As Tuple
public sealed class Tuple
public ref class Tuple sealed
[<SealedAttribute>]
type Tuple =  class end
public final class Tuple

Tuple 类型公开以下成员。

属性

  名称 说明
公共属性 Members Gets an instance of the MemberCollection class from the Tuple.
公共属性 TupleOrdinal Gets the ordinal position of the Tuple.

页首

方法

  名称 说明
公共方法 Equals Determines whether two instances of System..::..Object are equal. (覆盖 Object. . :: . .Equals(Object)。)
受保护方法 Finalize (从 Object 继承。)
公共方法 GetHashCode Serves as a hash function for a particular type, for use in hashing algorithms and data structures such as hash tables. (覆盖 Object. . :: . .GetHashCode() () () ()。)
公共方法 GetType (从 Object 继承。)
受保护方法 MemberwiseClone (从 Object 继承。)
公共方法 ToString (从 Object 继承。)

页首

运算符

  名称 说明
公共运算符静态成员 Equality Determines whether two specified instances of Tuple are equal.
公共运算符静态成员 Inequality Determines whether two specified instances of Tuple are not equal.

页首

注释

A tuple consists of an ordered collection of members.

A tuple cannot contain more than one member from any single hierarchy.

In ADOMD.NET, a Tuple is used to represent a tuple by encapsulating the collection of Member objects that define the tuple. Tuple objects can be referenced only through the Tuples property of a Set.

示例

The following function, given a Tuple, examines the object and returns a Multidimensional Expressions (MDX) string representation of the tuple:

Public Function GetTupleString(ByRef TupleToConvert As Tuple) As String
    If TupleToConvert Is Nothing Then
        Throw New System.ArgumentNullException("TupleToConvert")
    Else
        Dim tupleCount As Integer = TupleToConvert.Members.Count
        Dim tupleIndex As Integer = 0

        If tupleCount = 0 Then
            ' An empty tuple.
            Return "()"
        Else
            ' Iterate through each member in the Members collection,
            ' adding the value of the UniqueName property to a
            ' string.
            ' Because a tuple can represent many members, this
            ' example uses a StringBuilder object to improve
            ' string handling performance.
            Dim tupleString As New _
                System.Text.StringBuilder(15 * tupleCount)

            ' Tuples are framed with parentheses, with each member
            ' within a tuple separated by a comma.
            tupleString.Append("(")
            For tupleIndex = 0 To tupleCount - 1
                tupleString.Append( _
                TupleToConvert.Members(tupleIndex).UniqueName)
                If tupleIndex < (tupleCount - 1) Then
                    tupleString.Append(", ")
                End If
            Next
            tupleString.Append(")")

            Return tupleString.ToString
        End If
    End If
End Function

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。