public static class SelectorImpl.PseudoPageImpl extends Object implements Selector.PseudoPage
| Modifier | Constructor and Description |
|---|---|
protected |
SelectorImpl.PseudoPageImpl(String value,
String functionName) |
| 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) |
Selector.PseudoDeclaration |
getDeclaration() |
String |
getFunctionName() |
String |
getValue() |
int |
hashCode() |
protected boolean |
isSameElementType(Element e1,
Element e2)
Checks whether two elements have the same name.
|
boolean |
matches(Element e,
MatchCondition cond) |
protected boolean |
positionMatches(int pos,
int[] n)
Checks whether the element position matches a
an+b index specification. |
Selector.PseudoPage |
setFunctionName(String functionName) |
Selector.PseudoPage |
setValue(String value)
Sets value of pseudo.
|
String |
toString() |
public Selector.PseudoDeclaration getDeclaration()
getDeclaration in interface Selector.PseudoPagepublic String getFunctionName()
getFunctionName in interface Selector.PseudoPagepublic Selector.PseudoPage setFunctionName(String functionName)
setFunctionName in interface Selector.PseudoPagefunctionName - the functionName to setpublic void computeSpecificity(CombinedSelector.Specificity spec)
computeSpecificity in interface Selector.SelectorPartpublic boolean matches(Element e, MatchCondition cond)
matches in interface Selector.SelectorPartprotected boolean positionMatches(int pos,
int[] n)
an+b index specification.pos - The element position according to some counting criteria.n - The index specifiaction an+b - a and b values in array int[2].true when the position matches the index.protected int[] decodeIndex(String index) throws NumberFormatException
an+b form.index - the element index stringa and bNumberFormatExceptionprotected 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 boolean isSameElementType(Element e1, Element e2)
e1 - the first elemente2 - the second elementtrue when the elements have the same namespublic Selector.PseudoPage setValue(String value)
nullsetValue in interface Selector.PseudoPagevalue - New valuepublic String getValue()
getValue in interface Selector.PseudoPageCopyright © 2014. All rights reserved.