- All Superinterfaces:
Condition
,PositionalCondition
Updates SAC's
PositionalCondition
interface.-
Field Summary
Fields inherited from interface org.w3c.css.sac.Condition
SAC_AND_CONDITION, SAC_ATTRIBUTE_CONDITION, SAC_BEGIN_HYPHEN_ATTRIBUTE_CONDITION, SAC_CLASS_CONDITION, SAC_CONTENT_CONDITION, SAC_ID_CONDITION, SAC_LANG_CONDITION, SAC_NEGATIVE_CONDITION, SAC_ONE_OF_ATTRIBUTE_CONDITION, SAC_ONLY_CHILD_CONDITION, SAC_ONLY_TYPE_CONDITION, SAC_OR_CONDITION, SAC_POSITIONAL_CONDITION, SAC_PSEUDO_CLASS_CONDITION
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the An+B expression factor (i.e.int
Get the An+B expression offset (i.e.Get the list of selectors that the children have to match.boolean
The selector was specified with an argument ?boolean
The AnB expression is a keyword ?boolean
Is this a forward condition?boolean
isOfType()
Is this an of-type selector?Methods inherited from interface org.w3c.css.sac.Condition
getConditionType
Methods inherited from interface org.w3c.css.sac.PositionalCondition
getPosition, getType, getTypeNode
-
Method Details
-
isForwardCondition
boolean isForwardCondition()Is this a forward condition?- Returns:
true
if this is a forward condition (like nth-child),false
if not (like nth-last-child).
-
isOfType
boolean isOfType()Is this an of-type selector?This method only returns
true
if the selector has been explicitly declared to apply to the same type, like in 'first-of-type' or 'nth-of-type'. It should return false otherwise, for example for selectors like the next one despite being equivalent to 'first-of-type':div:nth-child(1 of div)
.This method is essentially the same as the old
PositionalCondition.getType()
, but with a more detailed (and potentially different) specification.- Returns:
true
if this condition has been declared as to be applied to the collection of elements that match the same type as the element to which it is applied (like nth-of-type),false
if not.
-
getFactor
int getFactor()Get the An+B expression factor (i.e. 'A').- Returns:
- the An+B expression factor, zero if not specified.
-
getOffset
int getOffset()Get the An+B expression offset (i.e. 'B').- Returns:
- the An+B expression offset, or the offset determined from the pseudo-class name (e.g. 'first-child', 'first-of-type' and 'last-child' all mean 1).
-
getOfList
SelectorList getOfList()Get the list of selectors that the children have to match.- Returns:
- the list of selectors that the children have to match, or null if not specified.
-
hasArgument
boolean hasArgument()The selector was specified with an argument ?This is useful to tell apart
:first-child
from:nth-child(1)
, for example.- Returns:
true
if the selector was specified with an argument.
-
hasKeyword
boolean hasKeyword()The AnB expression is a keyword ?- Returns:
true
if the AnB expression is a keyword likeodd
.
-