SetBuilder 클래스

Provides the functionality to create immutable sets.

상속 계층

System.Object
  Microsoft.AnalysisServices.AdomdServer.SetBuilder

네임스페이스:  Microsoft.AnalysisServices.AdomdServer
어셈블리:  msmgdsrv(msmgdsrv.dll)

구문

‘선언
Public NotInheritable Class SetBuilder _
    Implements IDisposable
‘사용 방법
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

SetBuilder 유형에서 다음 멤버를 표시합니다.

생성자

  이름 설명
공용 메서드 SetBuilder() Initializes a new instance of the SetBuilder class.
공용 메서드 SetBuilder(Tuple) Initializes a new instance of the SetBuilder class, with a given Tuple.

맨 위로 이동

속성

  이름 설명
공용 속성 Count Gets the number of Tuple objects in the set.
공용 속성 Item Gets the specified Tuple object.

맨 위로 이동

메서드

  이름 설명
공용 메서드 {dtor} Releases all resources used by the SetBuilder.
공용 메서드 Add Adds a Tuple to the set.
공용 메서드 Dispose Releases all resources used by the SetBuilder.
공용 메서드 Equals (Object에서 상속됨)
공용 메서드 GetHashCode (Object에서 상속됨)
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 ToSet Gets a Set based on the specified Tuple objects.
공용 메서드 ToString (Object에서 상속됨)

맨 위로 이동

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();
}

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

참고 항목

참조

Microsoft.AnalysisServices.AdomdServer 네임스페이스