fi.hut.tml.xsmiles.mlfc.css
Class XSmilesCSSRuleListImpl

java.lang.Object
  extended bycom.steadystate.css.dom.CSSRuleListImpl
      extended byfi.hut.tml.xsmiles.mlfc.css.XSmilesCSSRuleListImpl
All Implemented Interfaces:
org.w3c.dom.css.CSSRuleList, java.io.Serializable

public class XSmilesCSSRuleListImpl
extends com.steadystate.css.dom.CSSRuleListImpl
implements org.w3c.dom.css.CSSRuleList

MH: This class has been taken from Steady State CSS and modified for use with X-Smiles browser. XSmilesCSSOMParser generates instances of this type. Reason: allow sorting of rule lists

See Also:
Serialized Form

Nested Class Summary
static class XSmilesCSSRuleListImpl.CSSComparer
          a comparer class for the QuickSort algorithm in package mlfc.general
 
Field Summary
protected  java.util.Vector _rules
          the vector of rules, SS had private access
protected  short listState
          the current state
protected  MediaQueryEvaluator mqe
           
static short STATE_RULES_SORTED
           
static short STATE_RULES_SPLIT
           
static short UNINITIALIZED
           
 
Constructor Summary
XSmilesCSSRuleListImpl()
           
 
Method Summary
 void add(org.w3c.dom.css.CSSRule rule)
          this method is copied from the SS CSS implementation
 void appendFrom(XSmilesCSSRuleListImpl ruleList, int origin, boolean split, MediaQueryEvaluator mqe)
          appends all rules from ruleList into this rule list, comma separated rules will be split if 'spit' is true
 void appendTo(org.w3c.dom.css.CSSRuleList list)
           
protected  void clearRules()
           
 java.lang.Object clone()
           
 void delete(int index)
          this method is copied from the SS CSS implementation
 int getLength()
          this method is copied from the SS CSS implementation
 void insert(org.w3c.dom.css.CSSRule rule, int index)
          this method is copied from the SS CSS implementation
 org.w3c.dom.css.CSSRule item(int index)
          this method is copied from the SS CSS implementation
 void setMediaQueryEvaluator(MediaQueryEvaluator evaluator)
          this method splits all rules that are comma separated, and it also counts the specificity of all rules
 void sort()
          sorts this rule list according to the getSpecificity method from rule
protected  void splitAllRules()
           
 void splitAndAppend(XSmilesCSSStyleRule rule, org.w3c.css.sac.SelectorList selList, XSmilesCSSRuleListImpl ruleList, int origin)
          appends a single rule into this rule, but splits it if there are multiple selectors separeted with a comma
 java.lang.String toString()
          this method is copied from the SS CSS implementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNINITIALIZED

public static final short UNINITIALIZED
See Also:
Constant Field Values

STATE_RULES_SPLIT

public static final short STATE_RULES_SPLIT
See Also:
Constant Field Values

STATE_RULES_SORTED

public static final short STATE_RULES_SORTED
See Also:
Constant Field Values

listState

protected short listState
the current state


_rules

protected java.util.Vector _rules
the vector of rules, SS had private access


mqe

protected MediaQueryEvaluator mqe
Constructor Detail

XSmilesCSSRuleListImpl

public XSmilesCSSRuleListImpl()
Method Detail

sort

public void sort()
sorts this rule list according to the getSpecificity method from rule


appendTo

public void appendTo(org.w3c.dom.css.CSSRuleList list)

setMediaQueryEvaluator

public void setMediaQueryEvaluator(MediaQueryEvaluator evaluator)
this method splits all rules that are comma separated, and it also counts the specificity of all rules


splitAllRules

protected void splitAllRules()

clearRules

protected void clearRules()

appendFrom

public void appendFrom(XSmilesCSSRuleListImpl ruleList,
                       int origin,
                       boolean split,
                       MediaQueryEvaluator mqe)
appends all rules from ruleList into this rule list, comma separated rules will be split if 'spit' is true


splitAndAppend

public void splitAndAppend(XSmilesCSSStyleRule rule,
                           org.w3c.css.sac.SelectorList selList,
                           XSmilesCSSRuleListImpl ruleList,
                           int origin)
appends a single rule into this rule, but splits it if there are multiple selectors separeted with a comma


getLength

public int getLength()
this method is copied from the SS CSS implementation

Specified by:
getLength in interface org.w3c.dom.css.CSSRuleList

item

public org.w3c.dom.css.CSSRule item(int index)
this method is copied from the SS CSS implementation

Specified by:
item in interface org.w3c.dom.css.CSSRuleList

add

public void add(org.w3c.dom.css.CSSRule rule)
this method is copied from the SS CSS implementation


insert

public void insert(org.w3c.dom.css.CSSRule rule,
                   int index)
this method is copied from the SS CSS implementation


delete

public void delete(int index)
this method is copied from the SS CSS implementation


toString

public java.lang.String toString()
this method is copied from the SS CSS implementation


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException


X-Smiles 1.2