Package com.vaadin.client.flow.dom
Interface DomElement.DomTokenList
- Enclosing interface:
DomElement
@JsType(isNative=true)
public static interface DomElement.DomTokenList
A
DOMTokenList java representation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAddstokento the underlying string.booleanReturns whether the underlying string containstoken.intReturns thelengthproperty.item(int index) Returns an item in the list by its index.voidRemovestokenfrom the underlying string.booleanRemovestokenfrom string and returnsfalse.
-
Method Details
-
getLength
@JsProperty int getLength()Returns thelengthproperty.- Returns:
- the token list length
-
item
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
Returns whether the underlying string containstoken.- Parameters:
token- the token to check for- Returns:
trueif token was found,falseif not
-
add
Addstokento the underlying string.- Parameters:
token- the token to add
-
remove
Removestokenfrom the underlying string.- Parameters:
token- the token to remove
-
toggle
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
-