public class IDSelector extends java.lang.Object implements Selector
ElementRegistry
.
Equivalent to #id
selector in CSS. Its specificity is (0,1,0,0).
SpecificityHelper
Constructor and Description |
---|
IDSelector(java.lang.String id)
Creates an ID 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 IDSelector(java.lang.String id)
id
- the ID 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 int hashCode()
hashCode
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object