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
ConstructorsConstructorDescriptionHTMLOptionsCollectionImpl(NodeImpl rootNode, NodeFilter filter) Constructor for HTMLOptionsCollectionImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts element before the node given by before.voidadd(HTMLOptionElement element) add.intgetLength.intReturns the index of the first selected item, if any, or −1 if there is no selected item.booleanvoiditem.voidsetLength(int length) setLength.voidsetSelectedIndex(int selectedIndex) setSelectedIndex.toString()Methods inherited from class org.loboevolution.html.dom.domimpl.HTMLCollectionImpl
item, namedItemMethods 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, toArrayMethods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.loboevolution.html.dom.HTMLCollection
item, namedItemMethods inherited from interface org.loboevolution.html.dom.HTMLOptionsCollection
removeMethods 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- aNodeImplobject.filter- aNodeFilterobject.
-
-
Method Details
-
setLength
public void setLength(int length) setLength.
- Specified by:
setLengthin interfaceHTMLOptionsCollection- Parameters:
length- aIntegerobject.
-
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:
getSelectedIndexin interfaceHTMLOptionsCollection- Returns:
- a
Integerobject.
-
setSelectedIndex
public void setSelectedIndex(int selectedIndex) setSelectedIndex.
- Specified by:
setSelectedIndexin interfaceHTMLOptionsCollection- Parameters:
selectedIndex- aIntegerobject.
-
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:
addin interfaceHTMLOptionsCollection- Parameters:
element- aObjectobject.before- aObjectobject.- Throws:
DOMException
-
add
add.
- Specified by:
addin interfaceHTMLOptionsCollection- Parameters:
element- aHTMLOptionElementobject.
-
remove
- Specified by:
removein interfaceCollection<Node>- Specified by:
removein interfaceHTMLOptionsCollection- Specified by:
removein interfaceList<Node>- Overrides:
removein classAbstractList<Node>- Parameters:
element- the element- Returns:
- a boolean.
-
setItem
Description copied from interface:HTMLCollectionitem.
- Specified by:
setItemin interfaceHTMLCollection- Overrides:
setItemin classHTMLCollectionImpl- Parameters:
index- aIntegerobject.
-
getLength
public int getLength()Description copied from class:HTMLCollectionImplgetLength.
- Specified by:
getLengthin interfaceHTMLCollection- Specified by:
getLengthin interfaceHTMLOptionsCollection- Overrides:
getLengthin classHTMLCollectionImpl- Returns:
- a
Integerobject.
-
toString
- Overrides:
toStringin classHTMLCollectionImpl
-