public class DOMTokenList extends SimpleScriptable
DOMTokenList
.Constructor and Description |
---|
DOMTokenList()
Creates an instance.
|
DOMTokenList(Node node,
String attributeName)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String token)
Adds the specified token to the underlying string.
|
boolean |
contains(String token)
Checks if the specified token is contained in the underlying string.
|
Object |
get(int index,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start) |
String |
getDefaultValue(Class<?> hint)
Returns the JavaScript default value of this object.
|
int |
getLength()
Returns the length property.
|
Object |
item(int index)
Returns the item at the specified index.
|
void |
remove(String token)
Removes the specified token from the underlying string.
|
boolean |
toggle(String token)
Toggle the token, by adding or removing.
|
clone, equivalentValues, get, getBrowserVersion, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
defineFunctionProperties, defineProperty, getClassName, put, setClassName, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isReadOnlySettable, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, size
public int getLength()
public String getDefaultValue(Class<?> hint)
getDefaultValue
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
getDefaultValue
in class SimpleScriptable
hint
- a hint as to the format of the default value (ignored in this case)public void add(String token)
token
- the token to addpublic void remove(String token)
token
- the token to removepublic boolean toggle(String token)
token
- the token to add or removepublic boolean contains(String token)
token
- the token to addpublic Object item(int index)
index
- the index of the itempublic Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
Copyright © 2002–2020 Gargoyle Software Inc.. All rights reserved.