public class AttributeValuePrefixSelector extends java.lang.Object implements Selector
Checks that the attribute value is exactly the given value or starts with the given value immediately followed by "-" (U+002D).
Equivalent to [attribute|=value]
selector in CSS. Its specificity is (0,0,1,0).
Element.getAttribute(String)
,
SpecificityHelper
Constructor and Description |
---|
AttributeValuePrefixSelector(java.lang.String attribute,
java.lang.String value)
Creates an attribute value prefix selector.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
fit(Element element)
Checks whether or not the given element fits this selector.
|
int |
getSpecificity()
Gets the selector specificity.
|
int |
hashCode() |
public AttributeValuePrefixSelector(java.lang.String attribute, java.lang.String value)
attribute
- the attribute to check.value
- the value to check.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
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object