Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.util   Previous This
Package
Next

 


Class SetComparer

public final class SetComparer
{
  // Methods
  public static int compareSets (ProvideSetComparisonInfo set1,
        ProvideSetComparisonInfo set2);
}

This class compares sets that cannot be subtracted or otherwise have no "inverse" operator. The pseudo-set implements ProvideSetComparisonInfo and consists of two sets that together dictate membership.

The include set defines an enclosing set for all possible members of the set, and the exclude set defines members of the enclosing set that are removed.

Three basic operations are supported on the two sets using this class.

  • intersection: Produces a set with only the common members of two sets.
  • union: Produces a set with all the members of two sets.
  • comparison: Compares two sets and returns a SetComparison result.

The compareSets operator method makes the assumption that the union is relatively inexpensive to compute and intersection is relatively expensive. The include set is assumed to be an inclusive superset of the exclude set (otherwise, incorrect results might be returned). Because comparison is typically expensive, this invariant is not checked.

Methods

compareSets

public static int compareSets (ProvideSetComparisonInfo set1,
        ProvideSetComparisonInfo set2);

Compares two set rules.

Return Value:

Returns a SetComparison.compareSet return code.

ParameterDescription
set1 A set rule.
set2 A set rule.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.