Packages
 In this topic

*Constructors

*Methods

 

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

 


Class MultiComparison

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

This class 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. The constructor takes an array of Comparison objects. When requested to perform 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.

Constructors

MultiComparison

public MultiComparison(Comparison comparisons[]);

Constructs a new MultiComparison object with the specified comparison array.

ParameterDescription
comparisons An array of Comparison objects.

MultiComparison

public MultiComparison(Comparison comparisonA, Comparison comparisonB);

Constructs a new MultiComparison object with the specified comparisons.

ParameterDescription
comparisonA The first Comparison object in the comparison array.
comparisonB The second Comparison object in the comparison array.

Methods

compare

public int compare(Object p, Object q);

Compares the two objects according to the comparison array. The comparison terminates when one of the comparisons in the array determines that the objects are different.

Return Value:

Returns the result of the comparison.

ParameterDescription
p The first object to compare.
q The second object to compare.

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