Package com.vaadin.client.flow.dom
Interface DomElement.DomTokenList
-
- Enclosing interface:
- DomElement
@JsType(isNative=true) public static interface DomElement.DomTokenListA DOMTokenList java representation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(String token)Addstokento the underlying string.booleancontains(String token)Returns whether the underlying string containstoken.intgetLength()Returns thelengthproperty.Stringitem(int index)Returns an item in the list by its index.voidremove(String token)Removestokenfrom the underlying string.booleantoggle(String token)Removestokenfrom string and returnsfalse.
-
-
-
Method Detail
-
getLength
@JsProperty int getLength()
Returns thelengthproperty.- 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 containstoken.- Parameters:
token- the token to check for- Returns:
trueif token was found,falseif not
-
add
void add(String token)
Addstokento the underlying string.- Parameters:
token- the token to add
-
remove
void remove(String token)
Removestokenfrom the underlying string.- Parameters:
token- the token to remove
-
toggle
boolean toggle(String token)
Removestokenfrom string and returnsfalse. Iftokendoesn't exist it's added and the function returnstrue.- Parameters:
token- the token to toggle- Returns:
trueif token did not exist and was added,falseif token existed and was removed
-
-