List of selectors.
Based on SAC's SelectorList
interface by Philippe Le Hegaret.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check id this list contains the given selector.boolean
containsAll
(SelectorList list) Returnstrue
if this list contains all of the selectors in the given list.int
Get the length of this selector list.item
(int index) Get the selector at the specified index.default Selector
Replace the selector atindex
with the given selector.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
contains
Check id this list contains the given selector.Comparisons are made according to the
equals()
method.- Parameters:
selector
- the selector.- Returns:
true
if this list contains the selector.
-
containsAll
Returnstrue
if this list contains all of the selectors in the given list.- Parameters:
list
- the list to check.- Returns:
true
if this list contains all of the selectors in the list.
-
getLength
int getLength()Get the length of this selector list.- Returns:
- the length of this selector list, zero if empty.
-
item
Get the selector at the specified index.- Returns:
- the selector at the specified index, or
null
if the index is not valid.
-
replace
Replace the selector atindex
with the given selector.This method is not intended to trigger any event, so if you modify a a selector belonging to a rule obtained from the DOM, it is your responsibility to update the styles of the document.
- Parameters:
index
- the index at which the selector has to be replaced.selector
- the new selector.- Returns:
- the replaced selector.
- Throws:
DOMException
- INDEX_SIZE_ERR if theindex
is less than zero or greater than the largest possible index.
NO_MODIFICATION_ALLOWED_ERR if replacing selectors is not allowed.NullPointerException
- ifselector
isnull
.
-