All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xs.xs_PatternMatchLevel

java.lang.Object
   |
   +----xs.xs_PatternMatchLevel

public class xs_PatternMatchLevel
extends Object

A repository for the information about an XSL pattern which is used to determine precedence of patterns.

The values herein are calculated once as the XSL stylesheet is parsed, to enable efficient subsequent processing. To improve efficiency still further, a single overall match level is also calculated, taking into account the precendence of the constituent values. This only works if none of the constituent values exceeds 9; if any value exceeds 9, the individual values are compared.

Note that this class has no provision for resetting values: it assumes values will be set once at XSL parse time, and therefore only accommodates incrementing (increasing) values but not decrementing them.


Variable Index

 o AttSpecCount
9 - The number of attribute specifications in the pattern.
 o ClassCount
3 - The number of 'class' attributes in the pattern.
 o IdCount
2 - The number of 'id' attributes in the pattern.
 o OnlyCount
7 - The number of number of only qualifiers in the pattern.
 o OverallMatchLevel
The overall match level, based on a weighted calculation on the constituent values.
 o OverallMatchLevelValidFlag
Is the OverallMatchLevel valid for use in a simple comparison of two match levels? (It will be valid if all the constituent values are less than 9.) If false, a match is calculated laboriously by comparing each constituent value in turn.
 o PositionCount
8 - The number of position qualifiers in the pattern.
 o RuleImportanceLevel
1 - The importance of the rule to which this match level belongs.
 o RulePriorityLevel
6 - The priority of the rule to which this match level belongs.
 o TypeElementCount
4 - The number of element or target-element elements that have a type attribute.
 o WildcardCount
5 - The number of wildcards in the pattern.

Constructor Index

 o xs_PatternMatchLevel()

Method Index

 o calcOverallMatchLevel()
Calculate the overall match level, based on the constituent values.
 o compareTo(int, int)
Compare two integers.
 o compareTo(long, long)
Compare two longs.
 o compareTo(xs_PatternMatchLevel)
Compare this pattern match level against the InputPatternMatchLevel.
 o getAttSpecCount()
Get the number of attribute specifications in the pattern.
 o getClassCount()
Get the number of 'class' attributes in the pattern.
 o getIdCount()
Get the number of 'id' attributes in the pattern.
 o getOnlyCount()
Get the number of only qualifiers in the pattern.
 o getOverallMatchLevel()
Get the overall match level, based on the constituent values.
 o getPositionCount()
Get the number of position qualifiers in the pattern.
 o getRuleImportanceLevel()
Get the importance of the rule to which this match level belongs.
 o getRulePriorityLevel()
Get the priority of the rule to which this match level belongs.
 o getTypeElementCount()
Get the number of element or target-element elements that have a type attribute.
 o getWildcardCount()
Get the number of wildcards in the pattern.
 o increment(xs_PatternMatchLevel)
Add the constituents of the InputMatchLevel to this match level.
 o incrementAttSpecCount(int)
Increment the number of attribute specifications in the pattern.
 o incrementClassCount(int)
Increment the number of 'class' attributes in the pattern.
 o incrementIdCount(int)
Increment the number of 'id' attributes in the pattern.
 o incrementOnlyCount(int)
Increment the number of only qualifiers in the pattern.
 o incrementPositionCount(int)
Increment the number of position qualifiers in the pattern.
 o incrementTypeElementCount(int)
Increment the number of element or target-element elements that have a type attribute.
 o incrementWildcardCount(int)
Increment the number of wildcards in the pattern.
 o isOverallMatchLevelValid()
Get the flag which indicates whether the overall match level is valid for comparison purposes.
 o laboriousCompareTo(xs_PatternMatchLevel)
Perform a laborious comparison between this pattern match level and the That is, compare the individual constituents one by one.
 o setRuleImportanceLevel(int)
Set the importance of the rule to which this match level belongs.
 o setRulePriorityLevel(int)
Set the priority of the rule to which this match level belongs.
 o synchronize(int)
Recalculate the OverallMatchLevel and the OverallMatchLevelValidFlag after setting or incrementing one of the constituents, whose new value is InputConstituentValue.

Variables

 o OverallMatchLevel
 protected long OverallMatchLevel
The overall match level, based on a weighted calculation on the constituent values.

 o OverallMatchLevelValidFlag
 protected boolean OverallMatchLevelValidFlag
Is the OverallMatchLevel valid for use in a simple comparison of two match levels? (It will be valid if all the constituent values are less than 9.) If false, a match is calculated laboriously by comparing each constituent value in turn.

 o RuleImportanceLevel
 protected int RuleImportanceLevel
1 - The importance of the rule to which this match level belongs.

 o IdCount
 protected int IdCount
2 - The number of 'id' attributes in the pattern.

 o ClassCount
 protected int ClassCount
3 - The number of 'class' attributes in the pattern.

 o TypeElementCount
 protected int TypeElementCount
4 - The number of element or target-element elements that have a type attribute.

 o WildcardCount
 protected int WildcardCount
5 - The number of wildcards in the pattern. ('A wildcard is an any element, an element element without a type attribute, or a target-element element without a type attribute.')

 o RulePriorityLevel
 protected int RulePriorityLevel
6 - The priority of the rule to which this match level belongs.

 o OnlyCount
 protected int OnlyCount
7 - The number of number of only qualifiers in the pattern.

 o PositionCount
 protected int PositionCount
8 - The number of position qualifiers in the pattern.

 o AttSpecCount
 protected int AttSpecCount
9 - The number of attribute specifications in the pattern.

Constructors

 o xs_PatternMatchLevel
 public xs_PatternMatchLevel()

Methods

 o compareTo
 public int compareTo(xs_PatternMatchLevel InputMatchLevel)
Compare this pattern match level against the InputPatternMatchLevel. If the overall match level of both are valid, then a simple comparison of them are made; otherwise the individual constituents are compared one by one.

Parameters:
InputMatchLevel - The pattern match level to compare this against
Returns:
0 if this pattern match level is equal to the InputMatchLevel; less than 0 if this pattern match level is less than the InputMatchLevel; greater than 0 if this pattern match level is greater than the InputMatchLevel.
 o laboriousCompareTo
 public int laboriousCompareTo(xs_PatternMatchLevel InputMatchLevel)
Perform a laborious comparison between this pattern match level and the That is, compare the individual constituents one by one.

Parameters:
InputMatchLevel - The pattern match level to compare this against
Returns:
0 if this pattern match level is equal to the InputMatchLevel; less than 0 if this pattern match level is less than the InputMatchLevel; greater than 0 if this pattern match level is greater than the InputMatchLevel.
 o compareTo
 public int compareTo(int InputValue1,
                      int InputValue2)
Compare two integers.

Parameters:
InputValue1 - The first comarison value
InputValue2 - The second comarison value
Returns:
0 if InputValue1 is equal to InputValue2; less than 0 if InputValue1 is less than InputValue2 greater than 0 if InputValue1 is greater than InputValue2
 o compareTo
 public int compareTo(long InputValue1,
                      long InputValue2)
Compare two longs.

Parameters:
InputValue1 - The first comarison value
InputValue2 - The second comarison value
Returns:
0 if InputValue1 is equal to InputValue2; less than 0 if InputValue1 is less than InputValue2 greater than 0 if InputValue1 is greater than InputValue2
 o increment
 public void increment(xs_PatternMatchLevel InputMatchLevel)
Add the constituents of the InputMatchLevel to this match level.

Parameters:
InputMatchLevel - The match level whose constituents are to be added
 o setRuleImportanceLevel
 public void setRuleImportanceLevel(int InputRuleImportanceLevel)
Set the importance of the rule to which this match level belongs. (1)

Parameters:
InputRuleImportanceLevel - The importance of the rule to which this match level belongs
 o incrementIdCount
 public void incrementIdCount(int InputIdCount)
Increment the number of 'id' attributes in the pattern. (2)

Parameters:
InputIdCount - The number to be added to the number 'id' attributes in the pattern
 o incrementClassCount
 public void incrementClassCount(int InputClassCount)
Increment the number of 'class' attributes in the pattern. (3)

Parameters:
InputClassCount - The number to be added to the number of 'class' attributes in the pattern
 o incrementTypeElementCount
 public void incrementTypeElementCount(int InputTypeElementCount)
Increment the number of element or target-element elements that have a type attribute. (4)

Parameters:
InputTypeElementCount - The number to be added to the number of element or target-element elements that have a type attribute
 o incrementWildcardCount
 public void incrementWildcardCount(int InputWildcardCount)
Increment the number of wildcards in the pattern. (5)

Parameters:
InputWildcardCount - The number to be added to the number of wildcards in the pattern
 o setRulePriorityLevel
 public void setRulePriorityLevel(int InputRulePriorityLevel)
Set the priority of the rule to which this match level belongs. (6)

Parameters:
The - priority of the rule to which this match level belongs
 o incrementOnlyCount
 public void incrementOnlyCount(int InputOnlyCount)
Increment the number of only qualifiers in the pattern. (7)

Parameters:
InputOnlyCount - The number to be added to the number of only qualifiers in the pattern
 o incrementPositionCount
 public void incrementPositionCount(int InputPositionCount)
Increment the number of position qualifiers in the pattern. (8)

Parameters:
InputPositionCount - The number to be added to the number of position qualifiers in the pattern
 o incrementAttSpecCount
 public void incrementAttSpecCount(int InputAttSpecCount)
Increment the number of attribute specifications in the pattern. (9)

Parameters:
InputAttSpecCount - The number to be added to the number of attribute specifications in the pattern
 o synchronize
 protected void synchronize(int InputConstituentValue)
Recalculate the OverallMatchLevel and the OverallMatchLevelValidFlag after setting or incrementing one of the constituents, whose new value is InputConstituentValue.

Parameters:
InputConstituentValue - The new value of a constituent which has just changed
 o calcOverallMatchLevel
 public long calcOverallMatchLevel()
Calculate the overall match level, based on the constituent values.

Returns:
The overall match level
 o getOverallMatchLevel
 public long getOverallMatchLevel()
Get the overall match level, based on the constituent values.

Returns:
The overall match level
 o isOverallMatchLevelValid
 public boolean isOverallMatchLevelValid()
Get the flag which indicates whether the overall match level is valid for comparison purposes.

Returns:
The overall match level valid flag
 o getRuleImportanceLevel
 public int getRuleImportanceLevel()
Get the importance of the rule to which this match level belongs. (1)

Returns:
The importance of the rule to which this match level belongs
 o getIdCount
 public int getIdCount()
Get the number of 'id' attributes in the pattern. (2)

Returns:
The number of 'id' attributes in the pattern
 o getClassCount
 public int getClassCount()
Get the number of 'class' attributes in the pattern. (3)

Returns:
The number of 'class' attributes in the pattern
 o getTypeElementCount
 public int getTypeElementCount()
Get the number of element or target-element elements that have a type attribute. (4)

Returns:
The number of element or target-element elements that have a type attribute
 o getWildcardCount
 public int getWildcardCount()
Get the number of wildcards in the pattern. (5)

Returns:
The number of wildcards in the pattern
 o getRulePriorityLevel
 public int getRulePriorityLevel()
Get the priority of the rule to which this match level belongs. (6)

Returns:
The priority of the rule to which this match level belongs
 o getOnlyCount
 public int getOnlyCount()
Get the number of only qualifiers in the pattern. (7)

Returns:
The number of only qualifiers in the pattern
 o getPositionCount
 public int getPositionCount()
Get the number of position qualifiers in the pattern. (8)

Returns:
The number of position qualifiers in the pattern
 o getAttSpecCount
 public int getAttSpecCount()
Get the number of attribute specifications in the pattern. (9)

Returns:
The number of attribute specifications in the pattern

All Packages  Class Hierarchy  This Package  Previous  Next  Index