public class TypeNameSelector extends java.lang.Object implements Selector
Equivalent to element
selector in CSS. Its specificity is (0,0,0,1).
Object.getClass()
,
Class.getSimpleName()
,
SpecificityHelper
Constructor and Description |
---|
TypeNameSelector(java.lang.Class<?> type)
Creates a type name selector.
|
TypeNameSelector(java.lang.String typeName)
Creates a TypeNameSelector.
|
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 TypeNameSelector(java.lang.Class<?> type)
Equivalent to TypeNameSelector(String)
passing the type simple name.
type
- the type to check.Class.getSimpleName()
public TypeNameSelector(java.lang.String typeName)
Note that the case of the type name is ignored.
typeName
- the name of the type 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