Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Tuple Class

Represents an ordered collection of members from different hierarchies.


Namespace:  Microsoft.AnalysisServices.AdomdClient
Assembly:  Microsoft.AnalysisServices.AdomdClient (in Microsoft.AnalysisServices.AdomdClient.dll)

public sealed class Tuple

The Tuple type exposes the following members.

Public propertyMembersGets an instance of the MemberCollection class from the Tuple.
Public propertyTupleOrdinalGets the ordinal position of the Tuple.

Public methodEqualsDetermines whether two instances of System.Object are equal. (Overrides Object.Equals(Object).)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type, for use in hashing algorithms and data structures such as hash tables. (Overrides Object.GetHashCode().)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)

Public operatorStatic memberEqualityDetermines whether two specified instances of Tuple are equal.
Public operatorStatic memberInequalityDetermines 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")
        Dim tupleCount As Integer = TupleToConvert.Members.Count
        Dim tupleIndex As Integer = 0

        If tupleCount = 0 Then
            ' An empty tuple.
            Return "()"
            ' 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.
            For tupleIndex = 0 To tupleCount - 1
                tupleString.Append( _
                If tupleIndex < (tupleCount - 1) Then
                    tupleString.Append(", ")
                End If

            Return tupleString.ToString
        End If
    End If
End Function

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2015 Microsoft