    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.

##

AttSpecCount
  9 - The number of attribute specifications in the pattern.
ClassCount
  3 - The number of 'class' attributes in the pattern.
IdCount
  2 - The number of 'id' attributes in the pattern.
OnlyCount
  7 - The number of number of only qualifiers in the pattern.
OverallMatchLevel
  The overall match level, based on a weighted calculation on the constituent values.
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.
PositionCount
  8 - The number of position qualifiers in the pattern.
RuleImportanceLevel
  1 - The importance of the rule to which this match level belongs.
RulePriorityLevel
  6 - The priority of the rule to which this match level belongs.
TypeElementCount
  4 - The number of element or target-element elements that have a type attribute.
WildcardCount
  5 - The number of wildcards in the pattern.

##

xs_PatternMatchLevel()

##

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

##

OverallMatchLevel

     protected long OverallMatchLevel

  The overall match level, based on a weighted calculation on the constituent values.

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.

RuleImportanceLevel

     protected int RuleImportanceLevel

  1 - The importance of the rule to which this match level belongs.

IdCount

     protected int IdCount

  2 - The number of 'id' attributes in the pattern.

ClassCount

     protected int ClassCount

  3 - The number of 'class' attributes in the pattern.

TypeElementCount

     protected int TypeElementCount

  4 - The number of element or target-element elements that have a type attribute.

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.')

RulePriorityLevel

     protected int RulePriorityLevel

  6 - The priority of the rule to which this match level belongs.

OnlyCount

     protected int OnlyCount

  7 - The number of number of only qualifiers in the pattern.

PositionCount

     protected int PositionCount

  8 - The number of position qualifiers in the pattern.

AttSpecCount

     protected int AttSpecCount

  9 - The number of attribute specifications in the pattern.

##

xs_PatternMatchLevel

     public xs_PatternMatchLevel()

##

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.

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

calcOverallMatchLevel

     public long calcOverallMatchLevel()

  Calculate the overall match level, based on the constituent values.

  Returns:
    The overall match level

getOverallMatchLevel

     public long getOverallMatchLevel()

  Get the overall match level, based on the constituent values.

  Returns:
    The overall match level

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

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

getIdCount

     public int getIdCount()

  Get the number of 'id' attributes in the pattern. (2)

  Returns:
    The number of 'id' attributes in the pattern

getClassCount

     public int getClassCount()

  Get the number of 'class' attributes in the pattern. (3)

  Returns:
    The number of 'class' attributes in the pattern

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

getWildcardCount

     public int getWildcardCount()

  Get the number of wildcards in the pattern. (5)

  Returns:
    The number of wildcards in the pattern

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

getOnlyCount

     public int getOnlyCount()

  Get the number of only qualifiers in the pattern. (7)

  Returns:
    The number of only qualifiers in the pattern

getPositionCount

     public int getPositionCount()

  Get the number of position qualifiers in the pattern. (8)

  Returns:
    The number of position qualifiers in the pattern

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