Microsoft SDK for Java

MultiComparison Class

The MultiComparison Class of the com.ms.util package provides a comparison based on an array of other comparisons. It enables you to specify a group of comparisons to be applied in priority order.

public final class MultiComparison implements Comparison
{
  // Constructors
  public MultiComparison(Comparison comparisons[]);
  public MultiComparison(Comparison comparisonA,
        Comparison comparisonB);

  // Methods
  public int compare(Object p, Object q)
}

The constructor takes an array of Comparison objects. When requested to preform a comparison of two objects through the compare method, the first comparison in the array is applied; if that comparison finds they are equal, the next comparison is called. This continues until either a comparison finds the objects to be different, or all comparisons have been called.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.