Classe Tuple

Represents an ordered collection of members from different hierarchies.

Gerarchia di ereditarietà

System.Object
  Microsoft.AnalysisServices.AdomdClient.Tuple

Spazio dei nomi  Microsoft.AnalysisServices.AdomdClient
Assembly:  Microsoft.AnalysisServices.AdomdClient (in Microsoft.AnalysisServices.AdomdClient.dll)

Sintassi

'Dichiarazione
Public NotInheritable Class Tuple
'Utilizzo
Dim instance As Tuple
public sealed class Tuple
public ref class Tuple sealed
[<SealedAttribute>]
type Tuple =  class end
public final class Tuple

Nel tipo Tuple sono esposti i membri seguenti.

Proprietà

  Nome Descrizione
Proprietà pubblica Members Gets an instance of the MemberCollection class from the Tuple.
Proprietà pubblica TupleOrdinal Gets the ordinal position of the Tuple.

In alto

Metodi

  Nome Descrizione
Metodo pubblico Equals Determines whether two instances of System.Object are equal. Esegue l'override di Object.Equals(Object).
Metodo pubblico GetHashCode Serves as a hash function for a particular type, for use in hashing algorithms and data structures such as hash tables. Esegue l'override di Object.GetHashCode().
Metodo pubblico GetType Ereditato da Object.
Metodo pubblico ToString Ereditato da Object.

In alto

Operatori

  Nome Descrizione
Operatore pubblicoMembro statico Equality Determines whether two specified instances of Tuple are equal.
Operatore pubblicoMembro statico Inequality Determines whether two specified instances of Tuple are not equal.

In alto

Osservazioni

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.

Esempi

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

Protezione dei thread

I membri static (Shared in Visual Basic) pubblici di questo tipo sono affidabili. Non è invece garantita la sicurezza dei membri dell'istanza.

Vedere anche

Riferimento

Spazio dei nomi Microsoft.AnalysisServices.AdomdClient