Class DOMTokenListImpl
java.lang.Object
org.loboevolution.html.dom.domimpl.DOMTokenListImpl
- All Implemented Interfaces:
DOMTokenList
DOMTokenListImpl class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds all arguments passed, except those already present.booleanReturns true if token is present, and false otherwise.intReturns the number of tokens.getValue()Returns the associated set as string.item(int index) Returns the token with index index.voidvoidremove()voidRemoves arguments passed, if they are present.booleanReplaces token with newToken.voidsetValue.booleanReturns true if token is in the associated attribute's supported tokens.booleantoggle.booleanIf force is not given, "toggles" token, removing it if it's present and adding it if it's not present.toString()
-
Constructor Details
-
DOMTokenListImpl
Constructor for DOMTokenListImpl.
- Parameters:
element- aElementImplobject.
-
-
Method Details
-
getLength
public int getLength()Returns the number of tokens.- Specified by:
getLengthin interfaceDOMTokenList- Returns:
- a
Integerobject.
-
item
Returns the token with index index.- Specified by:
itemin interfaceDOMTokenList- Parameters:
index- aIntegerobject.- Returns:
- a
Stringobject.
-
contains
Returns true if token is present, and false otherwise.- Specified by:
containsin interfaceDOMTokenList- Parameters:
token- aStringobject.- Returns:
- a boolean.
-
add
Adds all arguments passed, except those already present. Throws a "SyntaxError" DOMException if one of the arguments is the empty string. Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.- Specified by:
addin interfaceDOMTokenList- Parameters:
token- aStringobject.- Throws:
DOMException
-
remove
Removes arguments passed, if they are present. Throws a "SyntaxError" DOMException if one of the arguments is the empty string. Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.- Specified by:
removein interfaceDOMTokenList- Parameters:
token- aStringobject.
-
remove
public void remove() -
toggle
toggle.
- Specified by:
togglein interfaceDOMTokenList- Parameters:
token- aStringobject.- Returns:
- a boolean.
- Throws:
DOMException
-
toggle
If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). Returns true if token is now present, and false otherwise. Throws a "SyntaxError" DOMException if token is empty. Throws an "InvalidCharacterError" DOMException if token contains any spaces.- Specified by:
togglein interfaceDOMTokenList- Parameters:
token- aStringobject.force- a boolean.- Returns:
- a boolean.
-
getValue
Returns the associated set as string. Can be set, to change the associated attribute.- Specified by:
getValuein interfaceDOMTokenList- Returns:
- a
Stringobject.
-
setValue
setValue.
- Specified by:
setValuein interfaceDOMTokenList- Parameters:
value- aStringobject.- Throws:
DOMException
-
replace
Replaces token with newToken. Returns true if token was replaced with newToken, and false otherwise. Throws a "SyntaxError" DOMException if one of the arguments is the empty string. Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.- Specified by:
replacein interfaceDOMTokenList- Parameters:
oldToken- aStringobject.newToken- aStringobject.- Returns:
- a boolean.
-
supports
Returns true if token is in the associated attribute's supported tokens. Returns false otherwise.Throws a TypeError if the associated attribute has no supported tokens defined.
- Specified by:
supportsin interfaceDOMTokenList- Parameters:
token- aStringobject.- Returns:
- a boolean.
-
populate
-
toString
-