public static class SelectorImpl.PseudoClassImpl extends Object implements Selector.PseudoClass
| Modifier | Constructor and Description |
|---|---|
protected |
PseudoClassImpl(String name) |
protected |
PseudoClassImpl(String name,
Selector nestedSelector) |
protected |
PseudoClassImpl(String name,
String functionValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
computeSpecificity(CombinedSelector.Specificity spec) |
protected int |
countSiblingsAfter(Element e,
boolean sameType)
Computes the count of element siblings after the given element in the DOM tree.
|
protected int |
countSiblingsBefore(Element e,
boolean sameType)
Computes the count of element siblings before the given element in the DOM tree.
|
protected int[] |
decodeIndex(String index)
Decodes the element index in the
an+b form. |
boolean |
equals(Object obj) |
String |
getFunctionValue() |
String |
getName() |
Selector |
getNestedSelector() |
Selector.PseudoClassType |
getType() |
int |
hashCode() |
protected boolean |
isSameElementType(Element e1,
Element e2)
Checks whether two elements have the same name.
|
boolean |
matches(Element e,
ElementMatcher matcher,
MatchCondition cond) |
protected boolean |
positionMatches(int pos,
int[] n)
Checks whether the element position matches a
an+b index specification. |
String |
toString() |
protected PseudoClassImpl(String name)
public String getName()
getName in interface Selector.PseudoClasspublic String getFunctionValue()
getFunctionValue in interface Selector.PseudoClasspublic Selector.PseudoClassType getType()
getType in interface Selector.PseudoClasspublic Selector getNestedSelector()
getNestedSelector in interface Selector.PseudoClasspublic void computeSpecificity(CombinedSelector.Specificity spec)
computeSpecificity in interface Selector.SelectorPartpublic boolean matches(Element e, ElementMatcher matcher, MatchCondition cond)
matches in interface Selector.SelectorPartprotected boolean isSameElementType(Element e1, Element e2)
e1 - the first elemente2 - the second elementtrue when the elements have the same namesprotected boolean positionMatches(int pos,
int[] n)
an+b index specification.pos - The element position according to some counting criteria.n - The index specification an+b - a and b values in array int[2].true when the position matches the index.protected int countSiblingsBefore(Element e, boolean sameType)
e - The element to be examinedsameType - when set to true only the element with the same type are considered.
Otherwise, all elements are considered.protected int countSiblingsAfter(Element e, boolean sameType)
e - The element to be examinedsameType - when set to true only the element with the same type are considered.
Otherwise, all elements are considered.protected int[] decodeIndex(String index)
an+b form.index - the element index stringa and b, or null if the index string is malformattedCopyright © 2019. All rights reserved.