javax.swing.text.html
Class StyleSheet.SelectorMapping

java.lang.Object
  extended byjavax.swing.text.html.StyleSheet.SelectorMapping
All Implemented Interfaces:
Serializable
Enclosing class:
StyleSheet

static class StyleSheet.SelectorMapping
extends Object
implements Serializable

SelectorMapping contains a specifitiy, as an integer, and an associated Style. It can also reference children SelectorMappings, so that it behaves like a tree.

This is not thread safe, it is assumed the caller will take the necessary precations if this is to be used in a threaded environment.


Field Summary
private  HashMap children
          Any sub selectors.
private  int specificity
          The specificity for this selector.
private  Style style
          Style for this selector.
 
Constructor Summary
StyleSheet.SelectorMapping(int specificity)
           
 
Method Summary
protected  StyleSheet.SelectorMapping createChildSelectorMapping(int specificity)
          Creates a child SelectorMapping with the specified specificity.
 StyleSheet.SelectorMapping getChildSelectorMapping(String selector, boolean create)
          Returns the child mapping identified by the simple selector selector.
protected  int getChildSpecificity(String selector)
          Returns the specificity for the child selector selector.
 int getSpecificity()
          Returns the specificity this mapping represents.
 Style getStyle()
          Returns the Style associated with this mapping.
 void setStyle(Style style)
          Sets the Style associated with this mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

specificity

private int specificity
The specificity for this selector.


style

private Style style
Style for this selector.


children

private HashMap children
Any sub selectors. Key will be String, and value will be another SelectorMapping.

Constructor Detail

StyleSheet.SelectorMapping

public StyleSheet.SelectorMapping(int specificity)
Method Detail

getSpecificity

public int getSpecificity()
Returns the specificity this mapping represents.


setStyle

public void setStyle(Style style)
Sets the Style associated with this mapping.


getStyle

public Style getStyle()
Returns the Style associated with this mapping.


getChildSelectorMapping

public StyleSheet.SelectorMapping getChildSelectorMapping(String selector,
                                                          boolean create)
Returns the child mapping identified by the simple selector selector. If a child mapping does not exist for selector, and create is true, a new one will be created.


createChildSelectorMapping

protected StyleSheet.SelectorMapping createChildSelectorMapping(int specificity)
Creates a child SelectorMapping with the specified specificity.


getChildSpecificity

protected int getChildSpecificity(String selector)
Returns the specificity for the child selector selector.