Interface DomElement.DomTokenList

Enclosing interface:
DomElement

@JsType(isNative=true) public static interface DomElement.DomTokenList
A DOMTokenList java representation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String token)
    Adds token to the underlying string.
    boolean
    Returns whether the underlying string contains token.
    int
    Returns the length property.
    item(int index)
    Returns an item in the list by its index.
    void
    remove(String token)
    Removes token from the underlying string.
    boolean
    toggle(String token)
    Removes token from string and returns false .
  • Method Details

    • getLength

      @JsProperty int getLength()
      Returns the length property.
      Returns:
      the token list length
    • item

      String item(int index)
      Returns an item in the list by its index.
      Parameters:
      index - the index to look for the item
      Returns:
      the token at the given index
    • contains

      boolean contains(String token)
      Returns whether the underlying string contains token.
      Parameters:
      token - the token to check for
      Returns:
      true if token was found, false if not
    • add

      void add(String token)
      Adds token to the underlying string.
      Parameters:
      token - the token to add
    • remove

      void remove(String token)
      Removes token from the underlying string.
      Parameters:
      token - the token to remove
    • toggle

      boolean toggle(String token)
      Removes token from string and returns false . If token doesn't exist it's added and the function returns true.
      Parameters:
      token - the token to toggle
      Returns:
      true if token did not exist and was added, false if token existed and was removed