laser.alphabet.labelpattern
Interface NotClassSetLabelPatternInterface<L extends LabelInterface>

Type Parameters:
L - The type of Label with respect to which this NotClassSetLabelPatternInterface has meaning.
All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable<LabelPatternInterface<? extends L>>, LabelPatternInterface<L>, java.io.Serializable
All Known Implementing Classes:
NotClassSetLabelPattern

public interface NotClassSetLabelPatternInterface<L extends LabelInterface>
extends LabelPatternInterface<L>

An interface implemented by "not class set" LabelPatterns.

The LabelPattern ~ or "not class set," with respect to an Alphabet of the correct type, specifies the subset, S, of all Labels in the Alphabet except for certain Labels that have been explicitly specified as being excluded from the subset, N. Labels can be added to the NotClassSetLabelPattern, effectively specifying them as being excluded from S (and included in N). Likewise, they can be removed, thus retracting such specification.

LabelPatterns can also be added to the NotClassSetLabelPattern, specifying their participation in determining S and (N). Likewise, such participation can be retracted by removing the LabelPatterns.

The subset S that NotClassSetLabelPattern P specifies is defined as follows: With respect to an Alphabet of the correct type, A, N is the union of the subsets of A specified by each of the LabelPatterns included in P, unioned with the set of all Labels that are included in P and contained in A. S is the set of all Labels in A and not in N.

Note that when adding and removing Labels and LabelPatterns to and from the NotClassSetLabelPattern, simple tests for equality are used. Labels are only compared to Labels via their equals methods, and LabelPatterns are only compared to LabelPatterns via their equals methods. Even though in the context of some Alphabet, a Label associated with this NotClassSetLabelPattern might also be in the subset specified by some LabelPattern associated with this NotClassSetLabelPattern, such relationships are not considered when adding or removing Labels or LabelPatterns.

For example, consider Alphabet A containing Label L. LabelPattern P, with respect to A, specifies the subset {L}. If both L and P are specified as being included in some NotClassSetLabelPattern (by the addExcludedLabel and addExcludedLabelPattern methods), and L is subsequently removed (via the removeExcludedLabel method), then with respect to A, the subset the NotClassSetLabelPattern specifies still does not contain L because even though L itself was removed from the NotClassSetLabelPattern, the simple equality test does not affect P's participation in the subset's specification.

Author:
Nathan A.Jokel (laser-software@cs.umass.edu)
See Also:
laser.alphabetinterface.labelpatterninterface.LabelPatternInterface

Method Summary
 boolean addExcludedLabel(L label)
          Specifies the given Label as being excluded from the subset this LabelPattern specifies.
 boolean addExcludedLabelPattern(LabelPatternInterface<L> labelPattern)
          Specifies the given LabelPattern as participating in determining the subset this LabelPattern specifies.
 boolean addExcludedLabelPatterns(java.util.Set<? extends LabelPatternInterface<L>> labelPatterns)
          Specifies each LabelPattern in the given Set as participating in determining the subset this LabelPattern specifies.
 boolean addExcludedLabels(java.util.Set<? extends L> labels)
          Specifies each Label in the given Set as being excluded from the subset this LabelPattern specifies.
 java.util.Set<LabelPatternInterface<L>> getExcludedLabelPatterns()
          Returns a Set containing all of the LabelPatterns specified as participating in determining the subset this NotClassSetLabelPattern specifies.
 java.util.Set<L> getExcludedLabels()
          Returns a Set containing all of the Labels specified as being excluded from the subset this NotClassSetLabelPattern specifies.
 boolean removeExcludedLabel(L label)
          Removes the specification that the given Label is to be excluded from the subset this LabelPattern specifies.
 boolean removeExcludedLabelPattern(LabelPatternInterface<L> labelPattern)
          Removes the specification that the given LabelPattern is to participate in determining the subset this LabelPattern specifies.
 boolean removeExcludedLabelPatterns(java.util.Set<? extends LabelPatternInterface<L>> labelPatterns)
          Removes the specification that each LabelPattern in the given Set is to participate in determining the subset this LabelPattern specifies.
 boolean removeExcludedLabels(java.util.Set<? extends L> labels)
          Removes the specification that each Label in the given Set is to be excluded from the subset this LabelPattern specifies.
 
Methods inherited from interface laser.alphabet.labelpattern.LabelPatternInterface
clone, equals, getMatchingLabels, hashCode
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

addExcludedLabel

boolean addExcludedLabel(L label)
Specifies the given Label as being excluded from the subset this LabelPattern specifies. If an equal Label (according to its equals method) is already specified as being so excluded, false is returned and this NotClassSetLabelPattern is unchanged, otherwise true is returned.

Parameters:
label - Label to be excluded.
Returns:
false if an equal Label is already specified as being excluded, true otherwise.
Throws:
java.lang.NullPointerException - if the specified Label is null.

addExcludedLabels

boolean addExcludedLabels(java.util.Set<? extends L> labels)
Specifies each Label in the given Set as being excluded from the subset this LabelPattern specifies. If an equal Label (according to its equals method) to every Label in the given Set is already specified as being so excluded, false is returned and this LabelPattern is unchanged, otherwise true is returned.

Parameters:
labels - Labels to be excluded.
Returns:
false if an equal Label (according to its equals method) to every Label in the given Set is already specified as being excluded from the subset this LabelPattern specifies, true otherwise.
Throws:
java.lang.NullPointerException - if the specified Set or any Label it contains is null.

addExcludedLabelPattern

boolean addExcludedLabelPattern(LabelPatternInterface<L> labelPattern)
Specifies the given LabelPattern as participating in determining the subset this LabelPattern specifies. If an equal LabelPattern (according to its equals method) is already so specified, false is returned and this NotClassSetLabelPattern is unchanged, otherwise true is returned.

Parameters:
labelPattern - LabelPattern to be excluded.
Returns:
false if an equal LabelPattern is already specified as participating, true otherwise.
Throws:
java.lang.NullPointerException - if the specified LabelPattern is null.

addExcludedLabelPatterns

boolean addExcludedLabelPatterns(java.util.Set<? extends LabelPatternInterface<L>> labelPatterns)
Specifies each LabelPattern in the given Set as participating in determining the subset this LabelPattern specifies. If an equal LabelPattern (according to its equals method) to every Label in the given Set is already so specified, false is returned and this LabelPattern is unchanged, otherwise true is returned.

Parameters:
labelPatterns - LabelPatterns to be excluded.
Returns:
false if an equal LabelPattern (according to its equals method) to every Label in the given Set is already specified as participating in determining the subset this LabelPattern specifies, true otherwise.
Throws:
java.lang.NullPointerException - if the specified Set or any LabelPattern it contains is null.

getExcludedLabels

java.util.Set<L> getExcludedLabels()
Returns a Set containing all of the Labels specified as being excluded from the subset this NotClassSetLabelPattern specifies. This Set is a copy, thus modifying it or any of the Labels it contains has no effect on the NotClassSetLabelPattern, nor does modifying the NotClassSetLabelPattern have any effect on the returned Set or any of the Labels it contains.

Returns:
a Set containing all of the Labels specified as being excluded from the subset this NotClassSetLabelPattern specifies.

getExcludedLabelPatterns

java.util.Set<LabelPatternInterface<L>> getExcludedLabelPatterns()
Returns a Set containing all of the LabelPatterns specified as participating in determining the subset this NotClassSetLabelPattern specifies. This Set is a copy, thus modifying it or any of the LabelPatterns it contains has no effect on the NotClassSetLabelPattern, nor does modifying the NotClassSetLabelPattern have any effect on the returned Set or any of the LabelPatterns it contains.

Returns:
a Set containing all of the LabelPatterns specified as participating in determining the subset this NotClassSetLabelPattern specifies.

removeExcludedLabel

boolean removeExcludedLabel(L label)
Removes the specification that the given Label is to be excluded from the subset this LabelPattern specifies. If an equal Label (according to its equals method) was specified as being so excluded, true is returned, otherwise false is returned and this NotClassSetLabelPattern is unchanged.

Parameters:
label - Label no longer to be excluded.
Returns:
true if a Label equal to the given Label was specified as being excluded, false otherwise.
Throws:
java.lang.NullPointerException - if the specified Label is null.

removeExcludedLabels

boolean removeExcludedLabels(java.util.Set<? extends L> labels)
Removes the specification that each Label in the given Set is to be excluded from the subset this LabelPattern specifies. If an equal Label (according to its equals method) to any Label in the given Set was specified as being so excluded, true is returned, otherwise false is returned and this LabelPattern is unchanged.

Parameters:
labels - Labels no longer to be excluded.
Returns:
true If an equal Label (according to its equals method) to any Label in the given Set was specified as being excluded from the subset this LabelPattern specifies, false otherwise.
Throws:
java.lang.NullPointerException - if the specified Set or any Label it contains is null.

removeExcludedLabelPattern

boolean removeExcludedLabelPattern(LabelPatternInterface<L> labelPattern)
Removes the specification that the given LabelPattern is to participate in determining the subset this LabelPattern specifies. If an equal LabelPattern (according to its equals method) was so specified, true is returned, otherwise false is returned and this NotClassSetLabelPattern is unchanged.

Parameters:
labelPattern - LabelPattern no longer to be excluded.
Returns:
true if a LabelPattern equal to the given Label was specified as participating, false otherwise.
Throws:
java.lang.NullPointerException - if the specified LabelPattern is null.

removeExcludedLabelPatterns

boolean removeExcludedLabelPatterns(java.util.Set<? extends LabelPatternInterface<L>> labelPatterns)
Removes the specification that each LabelPattern in the given Set is to participate in determining the subset this LabelPattern specifies. If an equal LabelPattern (according to its equals method) to any of the LabelPatterns in the given Set was so specified, true is returned, otherwise false is returned and this ClassSetLabelPattern is unchanged.

Parameters:
labelPatterns - LabelPatterns no longer to be excluded.
Returns:
true if an equal LabelPattern (according to its equals method) to any of the LabelPatterns in the given Set was specified as participating in determining the subset this LabelPattern specifies, false otherwise.
Throws:
java.lang.NullPointerException - if the specified Set or any LabelPattern it contains is null.