public final class CompoundSelector extends Selector
Selectors, along with an array of
CompoundSelectorRelationships indicating the required relationship at each
stage. There must be exactly one less Combinator than
there are selectors.
For example, the parameters [selector1, selector2, selector3]
and [Combinator.CHILD, Combinator.DESCENDANT] will match
a component when all of the following conditions hold:
selector1 > selector2 selector3. The greater-than (>)
between selector1 and selector2 specifies a direct CHILD, whereas the
whitespace between selector2 and selector3 corresponds to
Combinator.DESCENDANT.| Constructor and Description |
|---|
CompoundSelector(List<SimpleSelector> selectors,
List<Combinator> relationships) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applies(Styleable styleable) |
boolean |
equals(Object obj) |
List<Combinator> |
getRelationships()
The relationships between the selectors
|
List<SimpleSelector> |
getSelectors()
The selectors that make up this compound selector
|
int |
hashCode() |
static CompoundSelector |
readBinary(int bssVersion,
DataInputStream is,
String[] strings) |
boolean |
stateMatches(Styleable styleable,
Set<PseudoClass> states)
Determines whether the current state of the node and its parents
matches the pseudo-classes defined (if any) for this selector.
|
String |
toString() |
void |
writeBinary(DataOutputStream os,
StringStore stringStore) |
createSelector, getUniversalSelectorpublic CompoundSelector(List<SimpleSelector> selectors, List<Combinator> relationships)
public List<SimpleSelector> getSelectors()
public List<Combinator> getRelationships()
public boolean stateMatches(Styleable styleable, Set<PseudoClass> states)
SelectorstateMatches in class Selectorpublic final void writeBinary(DataOutputStream os, StringStore stringStore) throws IOException
writeBinary in class SelectorIOExceptionpublic static CompoundSelector readBinary(int bssVersion, DataInputStream is, String[] strings) throws IOException
IOExceptionCopyright © 2025. All rights reserved.