public class NthChildSelector extends java.lang.Object implements Selector
Equivalent to :nth-child
selector in CSS. Its specificity is (0,0,1,0).
Element.getParentElement()
,
SpecificityHelper
Constructor and Description |
---|
NthChildSelector(int index)
Creates a nth child selector.
|
Modifier and Type | Method and Description |
---|---|
boolean |
fit(Element element)
Checks whether or not the given element fits this selector.
|
int |
getSpecificity()
Gets the selector specificity.
|
public NthChildSelector(int index)
index
- the index of the child.public boolean fit(Element element)
Selector
public int getSpecificity()
Selector
See CSS for more information about calculating a selector's specificity.
getSpecificity
in interface Selector