共用方式為


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) 成員都是執行緒安全的。並不是所有的執行個體成員都保證可以用於所有的執行緒。