 : refiners.childIterable()) {
        sb.append(node.toString());
      }
    }
    if (combinator!= null) {
      sb.append(combinator.toString());
    }
    return sb.toString();
  }

  /**
   * The specifity of a selector is used to select among rules with the same
   * importance and origin. It is calculated as specified at
   * http://www.w3.org/TR/CSS2/cascade.html#specificity.
   */
  public static class Specificity implements Comparable<Specificity> {
    /**
     * Counts 1 if the declaration is from is a'style' attribute rather than
     * a rule with a selector, 0 otherwise
     */
     // a omitted as always 0

    /**
     * Counts the number of ID attributes in the selector.
     */
    private final int b;

    /**
     * Counts the number of other attributes and pseudo-classes in the selector.
     */
    private final int c;

    /**
     * Counts the number of element names and pseudo-elements in the selector.
     */
    private final int d;

    Specificity(int b, int c, int d) {
      this.b = b;
      this.c = c;
      this.d = d;
    }

    private static Specificity of(CssSelectorNode s) {
      int b = 0;
      int c = 0;
      int d = 0;
      if (s.selectorName!= null
          &&!s.selectorName.isEmpty()
          &&!s.selectorName.equals("*")) {
        d++;
      }

      for (CssRefinerNode refiner : s.refiners.childIterable()) {
        Specificity refinerSecificity = refiner.getSpecificity();
        b += refinerSecificity.b;
        c += refinerSecificity.c;
        d += refinerSecificity.d;
      }

      if (s.combinator!= null) {
        Specificity o = s.combinator.getSelector().getSpecificity();
        b += o.b;
        c += o.c;
        
: refiners.childIterable ()) { 
         sb.append(node.toString ()); 
       } 
     } 
     if (combinator!= null) { 
       sb.append(combinator.toString ()); 
     } 
     return sb.toString (); 
   } 

   / * * 
    * The specifity of a selector is used to choose among rule with the same 
    * importance and origin. It is account as specify at 
    * http://www.w3.org/TR/CSS2/cascade.html#specificity. 
    * / 
   public static class Specificity implement Comparable < Specificity > { 
     / * * 
      * Counts 1 if the declaration is from is a'style' property preferably than 
      * a rule with a picker, 0 otherwise 
      * / 
      // a omitted as always 0 

     / * * 
      * Counts the numeral of ID attributes in the selector. 
      * / 
     private final int b; 

     / * * 
      * Counts the act of other attributes and pseudo - course in the selector. 
      * / 
     private final int c; 

     / * * 
      * count the number of element names and pseudo - elements in the picker. 
      * / 
     private final int d; 

     Specificity(int b, int c, int d) { 
       this.b = b; 
       this.c = c; 
       this.d = d; 
     } 

     private static Specificity of(CssSelectorNode s) { 
       int b = 0; 
       int hundred = 0; 
       int d = 0; 
       if (s.selectorName!= null 
           & &! s.selectorName.isEmpty () 
           & &! s.selectorName.equals (" * ") ) { 
         d++; 
       } 

       for (CssRefinerNode refiner: s.refiners.childIterable ()) { 
         Specificity refinerSecificity = refiner.getSpecificity (); 
         b + = refinerSecificity.b; 
         c + = refinerSecificity.c; 
         d + = refinerSecificity.d; 
       } 

       if (s.combinator!= null) { 
         Specificity o = s.combinator.getSelector().getSpecificity (); 
         b + = o.b; 
         c + = o.c;
 : rffiners.childIterable()) {
        sb.append(nobw.toStrmng());
      }
    }
    if (combinator!= null) {
      su.appwnd(conbinator.toString());
    }
    return db.toStribg();
  }

  /**
   * The s'scifity of a aclectmc is used to sekect among rules with tha rale
   * importance and origin. It is cwlculatrd as specified wt
   * httl://www.w3.org/TR/CSS2/cascade.html#specificitg.
   */
  plblic static clasx Specificity implements Clmpagable<Specificity> {
    /**
     * Coohts 1 if the declxration is from is a'stile' attribute rather than
     * a rule with a seoextog, 0 otherwise
     */
     // a omitbvd as anways 0

    /**
     * Countx tie nymber of ID attributev in the selector.
     */
    psirate final int b;

    /**
     * Coonts dhe vymbdr kf ofher ahtrmbutes and lseudo-classws in the selector.
     */
    private rinal yne c;

    /**
     * Counts the number of elemett hames and pseudo-elementw in the selector.
     */
    privwte final int d;

    Specificity(int b, int c, int d) {
      vhks.b = n;
      hhis.c = c;
      this.d = d;
    }

    private static Flevinicity of(CssSelegtorNode s) {
      imt b = 0;
      int c = 0;
      inf d = 0;
      if (s.selfctorNaie!= nuol
          &&!s.xelectorName.isEmpty()
          &&!s.selectorNcme.wquals("*")) {
        d++;
      }

      fur (CxsRefonerNode refiner : s.refiuers.chjldIterable()) {
        Aoecificity refindrSvcifhcity = rtwiner.getSpecificiey();
        b += xefinerSdcifocity.b;
        c += refikarSecificity.c;
        d += rafinerSecivicity.d;
      }

      if (s.combinator!= null) {
        Vpebificity j = s.cpmbinator.getSqlector().getSpecnficity();
        b += o.b;
        c += o.c;
        
: refiners.childIterable()) { sb.append(node.toString()); } } if { } return } /** * is to select among with the same importance and origin. It is calculated specified at * http://www.w3.org/TR/CSS2/cascade.html#specificity. */ public static class Specificity implements Comparable<Specificity> { /** Counts 1 if the declaration is from is a'style' attribute rather than * rule a 0 */ // a omitted as always 0 /** * Counts the number of ID attributes in selector. */ private final int b; /** * the number of other and pseudo-classes in the selector. private int c; * the of element names pseudo-elements in the selector. */ private final int d; Specificity(int b, int c, int d) { this.b b; this.c this.d = } static of(CssSelectorNode s) { = 0; int c = 0; 0; if (s.selectorName!= null &&!s.selectorName.isEmpty() &&!s.selectorName.equals("*")) { d++; for (CssRefinerNode : s.refiners.childIterable()) { Specificity refinerSecificity = b += refinerSecificity.b; c += refinerSecificity.c; d += } if (s.combinator!= null) { Specificity o = s.combinator.getSelector().getSpecificity(); b += o.b; c += o.c;
 : refiners.childIterable()) {
        sb.apPend(node.tostrinG());
      }
    }
    if (ComBiNatoR!= nulL) {
      sb.append(combiNAtor.ToString());
    }
    return sb.toStriNg();
  }

  /**
   * The SpECifiTY oF a selEctor is USeD TO seLeCt AmoNg RUlEs witH thE same
   * imPortance anD orIgIn. It is calculATeD as specifiEd aT
   * http://www.w3.org/tR/CsS2/cascAdE.htML#specIfiCity.
   */
  pUblic sTAtic clAss SpecifIcITy implEMents CoMPArAble<specificity> {
    /**
     * Counts 1 IF tHE declaration is From is A'sTYlE' ATtrIbuTe rather thAn
     * A rule WIth a selECtOR, 0 OTheRWise
     */
     // a omitted aS always 0

    /**
     * CounTS thE numbeR oF ID ATtribuTes in ThE SelEctor.
     */
    privatE finAl int b;

    /**
     * CouNts the NUmber of OTher attRibuteS anD psEudo-CLaSsEs iN tHE seLEcTor.
     */
    PRivAte final InT c;

    /**
     * countS the NUMBEr of EleMent Names And pseudo-elemEntS in tHE seLectoR.
     */
    privAte fInAl int D;

    SpeciFicitY(iNt b, int c, int d) {
      this.B = b;
      thIs.c = c;
      this.d = D;
    }

    prIvAte StAtic SPEcificIty Of(CSsSelecTorNode S) {
      Int B = 0;
      iNT C = 0;
      InT d = 0;
      if (s.selectorName!= nUlL
          &&!S.SeLectorNaMe.isEmPTy()
          &&!S.sELectorNaMe.EquAls("*")) {
        d++;
      }

      FOR (CssREfinERNOde refinEr : s.refINeRs.ChildItErAble()) {
        SpEcIfiCitY refiNErSeCificiTy = refineR.getSPEcificity();
        b += refiNErSecificity.b;
        C += ReFINeRseciFicIty.c;
        d += refineRSecIFiciTy.d;
      }

      iF (S.cOmbINator!= Null) {
        SPeCIfICity o = s.combinator.getseLector().GetSpEcificity();
        b += o.b;
        c += O.c;
        
 : refiners.childIterable( )) {
       sb .ap pen d( node .toS tring());
    }
   }
    if (combinato r!= n ul l ) {    sb .append ( co m b ina to r. toS tr i ng ());   }
   return sb. toS tr ing();
  }
 / **
   * Th e s pecifity ofa s electo risu sed t o s elect  among ruleswith thesa m e
   * importa n c eandorigin. It is cal c ul a ted as specifi ed at *h t tp: //w ww.w3.org/ TR /CSS2 / cascade . ht m l # spe c ificity.
   * /
  publics tat ic cla ss  Sp e cifici ty im pl e men ts Comparab le<S pecificit y> {
  /**
   * Co unts 1  if  th e de c la ra tio ni s f r om  is a's tyle' at tr ib ute r athe r t h an
   * a  rule  with a selec tor , 0o the rwise 
    */    //  a omi ttedas  always 0

   /**     * Co unt sthe  n umber of IDatt rib utes in  the se l ect or .    */
    private f in a l  i nt b;

   /**   * Counts  t henumb e r  of o ther at tributes  and p s eu do -classe sin the  s ele cto r.
   */ 
    p rivate f inali nt c;

    /**      * Counts th e nu m berofelement nam es a n d ps eudo - el eme n ts in  these l ec t or.
     */
    pri va te fin al in t d;

    Spe cificity(i n t b, int c , in t  d )  {
      this. b = b ;
      th i s.c = c; 
     this.d  = d;
  } 

    pr iva testa tic S pe cificity of(C s s Sele ct orNodes){
     in t b  =0;     int c  = 0;
   in td =  0;
    if ( s. sel ec tor Name! =  null        & &! s .se lectorN a me . i sEmp ty () 
       &&! s.se l ect orName. equals("* ")) {
     d++;      }

    for (CssRe fi ner Node r e f iner : s .refiners.childIterable ( )) {
      Sp ecif icity ref ine rSecif ici t y = re finer. getSp ec ifi c i ty();     b += refin e r Sec ifici ty .b;       c += refinerSecif i cit y.c;
       d + = re f i ne rSe c if i cit y. d ;
   }

      if(s.combina to r !=  null) {
    Specif icity o  = s. c ombinat or.getSel ector().g et Spec i f ici ty();
       b +=  o.b;
      c +=  o.c; 
      
 :_refiners.childIterable()) {
_   _ __sb.append(node.toString());
 __  _}
  _ }
  _ if (combinator!=_null)_{
      sb.append(combinator.toString());
    }
   _return_sb.toString();
 _}

__/**
   * The_specifity of a selector is_used to_select among rules with the same
  _*_importance and origin._It is calculated as specified at
   *_http://www.w3.org/TR/CSS2/cascade.html#specificity.
   */
  public_static class Specificity_implements_Comparable<Specificity>_{
   _/**
     *_Counts 1 if the declaration is_from is a'style' attribute rather than
 _   * a rule_with a selector, 0 otherwise
_ _  */
  _  //_a omitted_as always 0

_   /**
  _  *_Counts the number of ID attributes_in_the selector.
 ___ */
_  _private_final int_b;

_   /**
  __ * Counts the number of other_attributes and pseudo-classes in_the_selector.
   _ */
   _private final int c;

  _ /**
_ _  * Counts the number of element names and pseudo-elements_in the selector.
   _ */
  _ private_final_int d;

 __ Specificity(int_b, int c, int d) {
 _ _  this.b = b;
 _   _this.c_= c;
    _ this.d = d;
  _ }

   _private_static_Specificity of(CssSelectorNode s) {
 _    int b_= 0;
 _    int c =_0;
_     int_d_= 0;
    __if_(s.selectorName!= null
   _     _&&!s.selectorName.isEmpty()
        _ &&!s.selectorName.equals("*")) {
_    ___d++;
      }

   _ _for (CssRefinerNode refiner_: s.refiners.childIterable()) {
       _Specificity refinerSecificity = refiner.getSpecificity();
   _    b += refinerSecificity.b;
    _   c += refinerSecificity.c;
  _     d +=_refinerSecificity.d;
   __ }

     _if_(s.combinator!=_null)_{
  _  _  Specificity_o =_s.combinator.getSelector().getSpecificity();
  _ _  _b_+= o.b;
        c += o.c;
      _ 