All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xs.xs_PatternElement

java.lang.Object
   |
   +----com.sun.java.swing.tree.DefaultMutableTreeNode
           |
           +----xg.xg_Node
                   |
                   +----xg.xg_Element
                           |
                           +----xs.xs_PatternElement

public class xs_PatternElement
extends xg_Element
An XML element representing a pattern within an XSL rule.


Variable Index

 o ClassAttName
The name of the attribute used to identify the class of this pattern.
 o IdAttName
The name of the attribute used to identify the ID of this pattern.
 o PatternNumberString
This pattern's number in the form of a string.

Constructor Index

 o xs_PatternElement()
Construct a pattern element with no type and no name.
 o xs_PatternElement(String)
Construct a pattern element with a name.

Method Index

 o addMatchLevelsOfChildren()
Add to this pattern's match level the match level of each of our children.
 o calcMatchLevel()
Calculate this pattern's match level, which includes figuring out the value of each of the match level's constituents.
 o compareMatchLevelTo(xs_PatternElement)
Compare the match level of this pattern against that of the InputPatternElement.
 o getMatchLevel()
Get this pattern's match level: the values which are used in determining which pattern to use in a given circumstance.
 o getPatternNumberString()
Get this patterns's sequential number (which must be set manually via an external call to setPatternNumber() ).
 o isBestMatch(xs_PatternElement, xg_Element)
See if this pattern matches the InputSourceElement, and is a better match than the InputBestPattern (which may be null).
 o isMatch(xg_Element)
See if this pattern matches the InputSourceElement.
 o setRuleNumber(int, int)
Set this pattern's identification number string (of the form "r.p", where r is the InputRuleNumber and p is the InputPatternNumber).
 o toString()
Return a string representation of the element (intended for use as debug output).

Variables

 o PatternNumberString
 protected String PatternNumberString
This pattern's number in the form of a string. Each pattern is given a sequential number within the rule it belongs to. This number is tagged on to the sequential number allocated to the rule, to yield a string of the form "r.p". This numbering is performed during XML parsing of the This number string is used purely to assist identification for a human user, and plays no part whatsoever in the XSL processing itself.

 o IdAttName
 public static final String IdAttName
The name of the attribute used to identify the ID of this pattern.

 o ClassAttName
 public static final String ClassAttName
The name of the attribute used to identify the class of this pattern.

Constructors

 o xs_PatternElement
 public xs_PatternElement()
Construct a pattern element with no type and no name.

 o xs_PatternElement
 public xs_PatternElement(String InputNodeName)
Construct a pattern element with a name.

Parameters:
InputNodeName - The name of the element

Methods

 o isBestMatch
 public boolean isBestMatch(xs_PatternElement InputBestPattern,
                            xg_Element InputSourceElement) throws xs_StyleException
See if this pattern matches the InputSourceElement, and is a better match than the InputBestPattern (which may be null). If so, return true; otherwise return false.

Parameters:
InputBestPattern - The best pattern found in previous rules (or null if no match has so far been found)
InputSourceElement - The source element to match
Returns:
true if this is now the best match; false if not
Throws: xs_StyleException
An error occurred processing the actions
 o isMatch
 public boolean isMatch(xg_Element InputSourceElement) throws xs_StyleException
See if this pattern matches the InputSourceElement. If so, return true. We expect this to be overridden in derived classes - because this version always returns false.

Parameters:
InputSourceElement - The source node to match
Returns:
The best pattern after checking this one: it will either be InputBestPattern or this
Throws: xs_StyleException
An error occurred
 o compareMatchLevelTo
 public int compareMatchLevelTo(xs_PatternElement InputPatternElement)
Compare the match level of this pattern against that of the InputPatternElement.

Parameters:
InputPatternElement - The pattern to compare against
Returns:
0 if this pattern's match level is equal to the InputPatternElement's match level; less than 0 if this pattern's match level is less than the InputPatternElement; greater than 0 if this pattern's match level is greater than the InputMatchLevel.
 o calcMatchLevel
 public void calcMatchLevel()
Calculate this pattern's match level, which includes figuring out the value of each of the match level's constituents.

 o addMatchLevelsOfChildren
 public void addMatchLevelsOfChildren()
Add to this pattern's match level the match level of each of our children. We assume each child's match level has already correctly calculated its own match level (including taking into account its own children).

 o setRuleNumber
 public void setRuleNumber(int InputRuleNumber,
                           int InputPatternNumber)
Set this pattern's identification number string (of the form "r.p", where r is the InputRuleNumber and p is the InputPatternNumber).

Parameters:
InputRuleNumber - The sequential number given to the rule to which this pattern belongs
InputPatternNumber - The sequential number given to this pattern within its rule
 o getMatchLevel
 public xs_PatternMatchLevel getMatchLevel()
Get this pattern's match level: the values which are used in determining which pattern to use in a given circumstance.

Returns:
This pattern's match level
 o getPatternNumberString
 public String getPatternNumberString()
Get this patterns's sequential number (which must be set manually via an external call to setPatternNumber() ).

Returns:
A string representation of the identification number given to this pattern
 o toString
 public String toString()
Return a string representation of the element (intended for use as debug output).

Returns:
String representing the node name and its type.
Overrides:
toString in class xg_Element

All Packages  Class Hierarchy  This Package  Previous  Next  Index