Packages
 In this topic

*Constructors

*Methods

 

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

 


Class IncludeExcludeIntRanges

public class IncludeExcludeIntRanges implements SetComparison, 
            ProvideSetComparisonInfo
{
  // Constructors
  public IncludeExcludeIntRanges (IntRanges include,
        IntRanges exclude);
  public IncludeExcludeIntRanges ( );

  // Methods
  public Object combineSetRules (Object o1, Object o2);
  public int compareSet (Object other);
  public int compareSetRules (Object o1, Object o2);
  public boolean contains (int n);
  public void excludeRange (int s, int e);
  public void excludeRanges (IntRanges ranges);
  public IntRanges getExcludedRanges ();
  public IntRanges getIncludedRanges ();
  public Object getSetRule (int rule);
  public String getStringForSetRule (Object o);
  public void includeRange (int s, int e);
  public void includeRanges (IntRanges ranges);
  public Object intersectSetRules (Object o1, Object o2);
  public void invalidate ();
  public boolean isEmptySetRule (Object o);
  public String toString ();
  public void validate ();
}

This class maintains a set of integers specified by a pair of IntRanges objects. The first IntRanges object specifies a set of integers that are included in the set, and the second specifies integers that are excluded from the set.

Constructors

IncludeExcludeIntRanges

public IncludeExcludeIntRanges (IntRanges include, IntRanges exclude);

Constructs a new IncludeExcludeIntRanges object given an IntRanges object matching the included integers and an IntRanges object matching the excluded integers.

ParameterDescription
include The integers that are included in the set.
exclude The integers that are excluded from the set.

IncludeExcludeIntRanges

public IncludeExcludeIntRanges ( );

Constructs an empty IncludeExcludeIntRanges object.

Methods

combineSetRules

public Object combineSetRules (Object o1, Object o2);

Combines two set rule objects.

Return Value:

Returns an object containing the combined set rules.

ParameterDescription
o1 The object containing the first set rule.
o2 The object containing the second set rule.

compareSet

public int compareSet (Object other);

Compares the current IncludeExcludeIntRanges object with another.

Return Value:

Returns a SetComparison.compareSet result code

ParameterDescription
other The object with which to compare this object.

compareSetRules

public int compareSetRules (Object o1, Object o2);

Compares two objects retrieved from getRule.

Return Value:

Returns a SetComparison.compareSet result code.

ParameterDescription
o1 The object containing the first set rule.
o2 The object containing the second set rule.

contains

public boolean contains (int n);

Determines if n is a member of the set.

Return Value:

Returns true if n is in the set.

ParameterDescription
n The integer to test for membership.

excludeRange

public void excludeRange (int s, int e);

Excludes a range of integers in the set.

Return Value:

No return value.

ParameterDescription
s The lower limit of the range.
e The upper limit of the range.

excludeRanges

public void excludeRanges (IntRanges ranges);

Excludes a set of integers in the set.

Return Value:

No return value.

ParameterDescription
ranges An IntRanges object specifying the integers to exclude.

getExcludedRanges

public IntRanges getExcludedRanges ();

Retrieves the set of all excluded ranges.

Return Value:

Returns a set of ranges.

getIncludedRanges

public IntRanges getIncludedRanges ();

Retrieves the set of all included ranges.

Return Value:

Returns a set of ranges.

getSetRule

public Object getSetRule (int rule);

Obtains an object representing the specified rule that can be used internally by SetComparer.

Return Value:

Returns the set rule object.

ParameterDescription
rule The rule that specifies the object to return.

getStringForSetRule

public String getStringForSetRule (Object o);

Retrieves a String representation of a given set rule.

Return Value:

Returns the set rule String.

ParameterDescription
o The object containing the set rule.

includeRange

public void includeRange (int s, int e);

Includes a range of integers in the set.

Return Value:

No return value.

ParameterDescription
s The lower limit of the range.
e The upper limit of the range.

includeRanges

public void includeRanges (IntRanges ranges);

Includes a set of integers in the set.

Return Value:

No return value.

ParameterDescription
ranges An IntRanges object specifying the integers to include.

intersectSetRules

public Object intersectSetRules (Object o1, Object o2);

Determines the intersection of two set rule objects.

Return Value:

Returns an object containing the intersection of the set rules.

ParameterDescription
o1 The object containing the first set rule.
o2 The object containing the second set rule.

invalidate

public void invalidate ();

Ensures that the set is in a valid state.

Remarks:

The set is automatically invalidated when additional expressions are included or excluded, and is automatically validated by other operators when necessary. If the set is already known to be in a valid state, this method does nothing. Validation is relatively expensive, so invoking this method in advance may speed up other operations that require validations.

isEmptySetRule

public boolean isEmptySetRule (Object o);

Determines if the set rule is empty or not.

Return Value:

Returns true if the set rule is empty; otherwise, returns false.

ParameterDescription
o The object containing the set rule.

toString

public String toString ();

Retrieves a string representation of the object.

Return Value:

Returns a String showing the IntRanges object's included and excluded sets.

validate

public void validate ();

Forces the next operation that requires the set to be valid to validate the set. The set can be manually placed in a valid state by invoking validate.

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