Class Combinator
- java.lang.Object
-
- ej.mwt.stylesheet.selector.combinator.Combinator
-
- All Implemented Interfaces:
Selector
- Direct Known Subclasses:
AdjacentSiblingCombinator,AndCombinator,ChildCombinator,DescendantCombinator,GeneralSiblingCombinator
public abstract class Combinator extends java.lang.Object implements Selector
A combinator is a selector that aggregates two selectors.The specificity of a combinator is the sum of the specificities of its selectors.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCombinator(Selector firstSelector, Selector secondSelector)Creates a combinator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)SelectorgetFirstSelector()Returns the first selector of this combinator.SelectorgetSecondSelector()Returns the second selector of this combinator.intgetSpecificity()Returns the specificity of this selector.inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ej.mwt.stylesheet.selector.Selector
appliesToWidget
-
-
-
-
Method Detail
-
getFirstSelector
public Selector getFirstSelector()
Returns the first selector of this combinator.- Returns:
- the first selector.
-
getSecondSelector
public Selector getSecondSelector()
Returns the second selector of this combinator.- Returns:
- the second selector.
-
getSpecificity
public int getSpecificity()
Description copied from interface:SelectorReturns the specificity of this selector.The specificity allows to determine in which order the rules of a stylesheet should be applied.
A specificity is composed of four numbers (defined by CSS2 specification):
- count 1 if the declaration is from is a 'style' attribute rather than a rule with a selector, 0 otherwise (= a)
- count the number of ID attributes in the selector (= b)
- count the number of other attributes and pseudo-classes in the selector (= c)
- count the number of widget names and pseudo-widgets in the selector (= d)
SelectorHelperprovides a method to compute the specificity of a selector.- Specified by:
getSpecificityin interfaceSelector- Returns:
- the specificity of this selector.
-
equals
public boolean equals(@Nullable java.lang.Object obj)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-