protected SelectorWeight createWeight() { if (silblingSelector instanceof CSSSelector == false || selector instanceof CSSSelector == false) { throw new ClassCastException("Invalid selector implementation!"); } CSSSelector anchestor = (CSSSelector) silblingSelector; CSSSelector simple = (CSSSelector) selector; return new SelectorWeight(anchestor.getWeight(), simple.getWeight()); }
public String print(final NamespaceCollection namespaces) { final CSSSelector anchestor = (CSSSelector) anchestorSelector; final CSSSelector simple = (CSSSelector) simpleSelector; if (childRelation) { return anchestor.print(namespaces) + " > " + simple.print(namespaces); } return anchestor.print(namespaces) + " " + simple.print(namespaces); }