Interface SelectorList

All Superinterfaces:
Iterable<Selector>

public interface SelectorList extends Iterable<Selector>
List of selectors.

Based on SAC's SelectorList interface by Philippe Le Hegaret.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(Selector selector)
    Check id this list contains the given selector.
    boolean
    Returns true 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(int index, Selector selector)
    Replace the selector at index with the given selector.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • contains

      boolean contains(Selector selector)
      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

      boolean containsAll(SelectorList list)
      Returns true 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

      Selector item(int index)
      Get the selector at the specified index.
      Returns:
      the selector at the specified index, or null if the index is not valid.
    • replace

      default Selector replace(int index, Selector selector) throws DOMException
      Replace the selector at index 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 the index is less than zero or greater than the largest possible index.
      NO_MODIFICATION_ALLOWED_ERR if replacing selectors is not allowed.
      NullPointerException - if selector is null.