Packages
 In this topic

*Constructors

*Methods

 

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

 


Class IncludeExcludeWildcards

public class IncludeExcludeWildcards implements 
            ProvideSetComparisonInfo, SetComparison
{
  // Constructors
  public IncludeExcludeWildcards (WildcardExpression include,
        WildcardExpression exclude);

  // Methods
  public Object combineSetRules (Object o1, Object o2);
  public int compareSet (Object other);
  public int compareSetRules (Object o1, Object o2);
  public synchronized void exclude (WildcardExpression expr);
  public WildcardExpression getExcludeExpression ();
  public WildcardExpression getIncludeExpression ();
  public Object getSetRule (int rule);
  public String getStringForSetRule (Object o);
  public synchronized void include (WildcardExpression expr);
  public Object intersectSetRules (Object o1, Object o2);
  public synchronized void invalidate ();
  public boolean isEmptySetRule (Object o);
  public boolean match (String s);
  public String toString ();
  public synchronized void validate ();
}

This class maintains a set of strings specified by a pair of WildcardExpression objects. The first expression specifies a set of strings that are included in the set, and the second specifies strings that are excluded from the set. Because WildcardExpressions cannot be subtracted, this class provides a way of emulating subtraction.

Constructors

IncludeExcludeWildcards

public IncludeExcludeWildcards (WildcardExpression include,
        WildcardExpression exclude);

Constructs a new IncludeExcludeWildcards object given a WildcardExpression matching the included strings and a WildcardExpression matching the excluded strings.

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

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 this IncludeExcludeWildcards object against another IncludeExcludeWildcards object.

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.

exclude

public synchronized void exclude (WildcardExpression expr);

Adds an expression matching the strings that should be excluded in the set.

Return Value:

No return value.

ParameterDescription
expr A WildcardExpression specifying strings that should be excluded.

getExcludeExpression

public WildcardExpression getExcludeExpression ();

Retrieves the WildcardExpression object that specifies the strings that are excluded from the set.

Return Value:

Returns the WildcardExpression object that specifies the strings that are excluded from the set. If the IncludeExcludeWildcards object was created with a null exclude parameter and the exclude method has not been called, the method returns null.

See Also: exclude

getIncludeExpression

public WildcardExpression getIncludeExpression ();

Retrieves the WildcardExpression object that specifies the strings that are included in the set.

Return Value:

Returns the WildcardExpression object that specifies the strings that are included in the set. If the IncludeExcludeWildcards object was created with a null include parameter and the include method has not been called, the method returns null.

See Also: include

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.

include

public synchronized void include (WildcardExpression expr);

Adds an expression matching the strings that should be included in the set.

Return Value:

No return value.

ParameterDescription
expr A WildcardExpression specifying strings that should be included.

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 synchronized void invalidate ();

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.

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.

match

public boolean match (String s);

Determines if s is a member of the set.

Return Value:

Returns true if s is in the set.

ParameterDescription
s The String to test for membership.

toString

public String toString ();

Retrieves a string representation of the IncludeExcludeWildcards object.

Return Value:

Returns a string containing both the include and exclude WildcardExpression objects.

validate

public synchronized void validate ();

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.

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