public abstract class Combinator extends java.lang.Object implements Selector
The specificity of a combinator is the sum of the specificities of its children.
Modifier and Type | Field and Description |
---|---|
protected Selector[] |
selectors
Wrapped selectors list.
|
Constructor and Description |
---|
Combinator(Selector... selectors)
Creates a combinator with several children.
|
Combinator(Selector selector1,
Selector selector2)
Creates a combinator with two children.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getSpecificity()
Gets the selector specificity.
|
int |
hashCode() |
protected final Selector[] selectors
public Combinator(Selector selector1, Selector selector2)
selector1
- the first child.selector2
- the second child.public Combinator(Selector... selectors)
selectors
- the list of selectors.java.lang.IllegalArgumentException
- if there is less than two selectors.public int getSpecificity()
Selector
See CSS for more information about calculating a selector's specificity.
getSpecificity
in interface Selector
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object