Stay organized with collections
Save and categorize content based on your preferences.
DOMStringList
public
interface
DOMStringList
org.w3c.dom.DOMStringList
|
The DOMStringList
interface provides the abstraction of an
ordered collection of DOMString
values, without defining or
constraining how this collection is implemented. The items in the
DOMStringList
are accessible via an integral index, starting
from 0.
See also the Document Object Model (DOM) Level 3 Core Specification.
Summary
Public methods |
abstract
boolean
|
contains(String str)
Test if a string is part of this DOMStringList .
|
abstract
int
|
getLength()
The number of DOMString s in the list.
|
abstract
String
|
item(int index)
Returns the index th item in the collection.
|
Public methods
contains
public abstract boolean contains (String str)
Test if a string is part of this DOMStringList
.
Parameters |
str |
String : The string to look for. |
Returns |
boolean |
true if the string has been found,
false otherwise. |
getLength
public abstract int getLength ()
The number of DOMString
s in the list. The range of valid
child node indices is 0 to length-1
inclusive.
item
public abstract String item (int index)
Returns the index
th item in the collection. If
index
is greater than or equal to the number of
DOMString
s in the list, this returns null
.
Parameters |
index |
int : Index into the collection. |
Returns |
String |
The DOMString at the index th
position in the DOMStringList , or null if
that is not a valid index. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DOMStringList\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nDOMStringList\n=============\n\n\n`\npublic\n\n\ninterface\nDOMStringList\n`\n\n\n`\n\n\n`\n\n|---------------------------|\n| org.w3c.dom.DOMStringList |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe `DOMStringList` interface provides the abstraction of an\nordered collection of `DOMString` values, without defining or\nconstraining how this collection is implemented. The items in the\n`DOMStringList` are accessible via an integral index, starting\nfrom 0.\n\nSee also the [Document Object Model (DOM) Level 3 Core Specification](http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407).\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[contains](/reference/org/w3c/dom/DOMStringList#contains(java.lang.String))`(`[String](/reference/java/lang/String)` str) ` Test if a string is part of this `DOMStringList`. |\n| ` abstract int` | ` `[getLength](/reference/org/w3c/dom/DOMStringList#getLength())`() ` The number of `DOMString`s in the list. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[item](/reference/org/w3c/dom/DOMStringList#item(int))`(int index) ` Returns the `index`th item in the collection. |\n\nPublic methods\n--------------\n\n### contains\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean contains (String str)\n```\n\nTest if a string is part of this `DOMStringList`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|------------------------------------------|\n| `str` | `String`: The string to look for. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|----------------------------------------------------------------|\n| `boolean` | `true` if the string has been found, `false` otherwise. \u003cbr /\u003e |\n\n### getLength\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getLength ()\n```\n\nThe number of `DOMString`s in the list. The range of valid\nchild node indices is 0 to `length-1` inclusive.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### item\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String item (int index)\n```\n\nReturns the `index`th item in the collection. If\n`index` is greater than or equal to the number of\n`DOMString`s in the list, this returns `null`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|------------------------------------------|\n| `index` | `int`: Index into the collection. \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| [String](/reference/java/lang/String) | The `DOMString` at the `index`th position in the `DOMStringList`, or `null` if that is not a valid index. \u003cbr /\u003e |"]]