Class HTMLOptionsCollectionImpl
java.lang.Object
org.loboevolution.js.AbstractScriptableDelegate
org.loboevolution.html.node.AbstractList<Node>
org.loboevolution.html.dom.domimpl.HTMLCollectionImpl
org.loboevolution.html.dom.domimpl.HTMLOptionsCollectionImpl
- All Implemented Interfaces:
Iterable<Node>
,Collection<Node>
,List<Node>
,SequencedCollection<Node>
,HTMLCollection
,HTMLOptionsCollection
,ScriptableDelegate
HTMLOptionsCollectionImpl class.
-
Constructor Summary
ConstructorDescriptionHTMLOptionsCollectionImpl
(NodeImpl rootNode, NodeFilter filter) Constructor for HTMLOptionsCollectionImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Inserts element before the node given by before.void
add
(HTMLOptionElement element) add.int
getLength.int
Returns the index of the first selected item, if any, or −1 if there is no selected item.boolean
void
item.void
setLength
(int length) setLength.void
setSelectedIndex
(int selectedIndex) setSelectedIndex.toString()
Methods inherited from class org.loboevolution.html.dom.domimpl.HTMLCollectionImpl
item, namedItem
Methods inherited from class org.loboevolution.html.node.AbstractList
add, add, addAll, addAll, clear, contains, containsAll, get, getList, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, set, setList, size, subList, toArray, toArray
Methods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface org.loboevolution.html.dom.HTMLCollection
item, namedItem
Methods inherited from interface org.loboevolution.html.dom.HTMLOptionsCollection
remove
Methods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
HTMLOptionsCollectionImpl
Constructor for HTMLOptionsCollectionImpl.
- Parameters:
rootNode
- aNodeImpl
object.filter
- aNodeFilter
object.
-
-
Method Details
-
setLength
public void setLength(int length) setLength.
- Specified by:
setLength
in interfaceHTMLOptionsCollection
- Parameters:
length
- aInteger
object.
-
getSelectedIndex
public int getSelectedIndex()Returns the index of the first selected item, if any, or −1 if there is no selected item.Can be set, to change the selection.
- Specified by:
getSelectedIndex
in interfaceHTMLOptionsCollection
- Returns:
- a
Integer
object.
-
setSelectedIndex
public void setSelectedIndex(int selectedIndex) setSelectedIndex.
- Specified by:
setSelectedIndex
in interfaceHTMLOptionsCollection
- Parameters:
selectedIndex
- aInteger
object.
-
add
Inserts element before the node given by before.The before argument can be a number, in which case element is inserted before the item with that number, or an element from the collection, in which case element is inserted before that element.
If before is omitted, null, or a number out of range, then element will be added at the end of the list.
This method will throw a "HierarchyRequestError" DOMException if element is an ancestor of the element into which it is to be inserted.
- Specified by:
add
in interfaceHTMLOptionsCollection
- Parameters:
element
- aObject
object.before
- aObject
object.- Throws:
DOMException
-
add
add.
- Specified by:
add
in interfaceHTMLOptionsCollection
- Parameters:
element
- aHTMLOptionElement
object.
-
remove
- Specified by:
remove
in interfaceCollection<Node>
- Specified by:
remove
in interfaceHTMLOptionsCollection
- Specified by:
remove
in interfaceList<Node>
- Overrides:
remove
in classAbstractList<Node>
- Parameters:
element
- the element- Returns:
- a boolean.
-
setItem
Description copied from interface:HTMLCollection
item.
- Specified by:
setItem
in interfaceHTMLCollection
- Overrides:
setItem
in classHTMLCollectionImpl
- Parameters:
index
- aInteger
object.
-
getLength
public int getLength()Description copied from class:HTMLCollectionImpl
getLength.
- Specified by:
getLength
in interfaceHTMLCollection
- Specified by:
getLength
in interfaceHTMLOptionsCollection
- Overrides:
getLength
in classHTMLCollectionImpl
- Returns:
- a
Integer
object.
-
toString
- Overrides:
toString
in classHTMLCollectionImpl
-