Class DOMTokenListImpl
java.lang.Object
org.loboevolution.html.dom.domimpl.DOMTokenListImpl
- All Implemented Interfaces:
DOMTokenList
DOMTokenListImpl class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds all arguments passed, except those already present.boolean
Returns true if token is present, and false otherwise.int
Returns the number of tokens.getValue()
Returns the associated set as string.item
(int index) Returns the token with index index.void
void
remove()
void
Removes arguments passed, if they are present.boolean
Replaces token with newToken.void
setValue.boolean
Returns true if token is in the associated attribute's supported tokens.boolean
toggle.boolean
If 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
- aElementImpl
object.
-
-
Method Details
-
getLength
public int getLength()Returns the number of tokens.- Specified by:
getLength
in interfaceDOMTokenList
- Returns:
- a
Integer
object.
-
item
Returns the token with index index.- Specified by:
item
in interfaceDOMTokenList
- Parameters:
index
- aInteger
object.- Returns:
- a
String
object.
-
contains
Returns true if token is present, and false otherwise.- Specified by:
contains
in interfaceDOMTokenList
- Parameters:
token
- aString
object.- 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:
add
in interfaceDOMTokenList
- Parameters:
token
- aString
object.- 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:
remove
in interfaceDOMTokenList
- Parameters:
token
- aString
object.
-
remove
public void remove() -
toggle
toggle.
- Specified by:
toggle
in interfaceDOMTokenList
- Parameters:
token
- aString
object.- 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:
toggle
in interfaceDOMTokenList
- Parameters:
token
- aString
object.force
- a boolean.- Returns:
- a boolean.
-
getValue
Returns the associated set as string. Can be set, to change the associated attribute.- Specified by:
getValue
in interfaceDOMTokenList
- Returns:
- a
String
object.
-
setValue
setValue.
- Specified by:
setValue
in interfaceDOMTokenList
- Parameters:
value
- aString
object.- 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:
replace
in interfaceDOMTokenList
- Parameters:
oldToken
- aString
object.newToken
- aString
object.- 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:
supports
in interfaceDOMTokenList
- Parameters:
token
- aString
object.- Returns:
- a boolean.
-
populate
-
toString
-