Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Provides the functionality to create immutable sets.
Jerarquía de herencia
System.Object
Microsoft.AnalysisServices.AdomdServer.SetBuilder
Espacio de nombres: Microsoft.AnalysisServices.AdomdServer
Ensamblado: msmgdsrv (en msmgdsrv.dll)
Sintaxis
'Declaración
Public NotInheritable Class SetBuilder _
Implements IDisposable
'Uso
Dim instance As SetBuilder
public sealed class SetBuilder : IDisposable
public ref class SetBuilder sealed : IDisposable
[<SealedAttribute>]
type SetBuilder =
class
interface IDisposable
end
public final class SetBuilder implements IDisposable
El tipo SetBuilder expone los siguientes miembros.
Constructores
| Nombre | Descripción | |
|---|---|---|
![]() |
SetBuilder() | Initializes a new instance of the SetBuilder class. |
![]() |
SetBuilder(Tuple) | Initializes a new instance of the SetBuilder class, with a given Tuple. |
Arriba
Propiedades
| Nombre | Descripción | |
|---|---|---|
![]() |
Count | Gets the number of Tuple objects in the set. |
![]() |
Item | Gets the specified Tuple object. |
Arriba
Métodos
| Nombre | Descripción | |
|---|---|---|
![]() |
{dtor} | Releases all resources used by the SetBuilder. |
![]() |
Add | Adds a Tuple to the set. |
![]() |
Dispose | Releases all resources used by the SetBuilder. |
![]() |
Equals | (Se hereda de Object.) |
![]() |
GetHashCode | (Se hereda de Object.) |
![]() |
GetType | (Se hereda de Object.) |
![]() |
ToSet | Gets a Set based on the specified Tuple objects. |
![]() |
ToString | (Se hereda de Object.) |
Arriba
Ejemplos
The following example takes a set and a return count, and randomly retrieves tuples from the set, returning a final subset.
public Set RandomSample(Set set, int returnCount)
{
//Return the original set if there are fewer tuples
//in the set than the number requested.
if (set.Tuples.Count <= returnCount)
return set;
System.Random r = new System.Random();
SetBuilder returnSet = new SetBuilder();
//Retrieve random tuples until the return set is filled.
int i = set.Tuples.Count;
foreach (Tuple t in set.Tuples)
{
if (r.Next(i) < returnCount)
{
returnCount--;
returnSet.Add(t);
}
i--;
//Stop the loop if we have enough tuples.
if (returnCount == 0)
break;
}
return returnSet.ToSet();
}
Seguridad para subprocesos
Cualquier miembro público static (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancia sean seguros para subprocesos.
.gif)
.gif)