Package com.microstrategy.web.objects
Interface WebElements
-
public interface WebElementsThe WebElements interface represents a collection ofWebElementobjects. This collection is both indexed and keyed. All elements in the collection must have the same parent attribute in the current product release. This object cannot be directly instantiated, and must instead be obtained from interfaces such asWebElementsObjectNode,WebElementsPromptorWebElementSource.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebElementadd(java.lang.String elementID)Creates a newWebElementobject using the given parameters, adds it to the elements collection, and returns the newly created object.WebElementadd(java.lang.String elementID, java.lang.String displayName)Creates a newWebElementobject using the given parameters, adds it to the elements collection, and returns the newly created object.WebElementadd(java.lang.String elementID, java.lang.String displayName, java.lang.String displayForm)Creates a newWebElementobject using the given parameters, adds it to the elements collection, and returns the newly created object.voidbuildShortXML(WebXMLBuilder builder)voidclear()Removes all elements from the collection.booleancontainsKey(int key)Returns true if the given key exists in the collection, false if it does not.WebElementscreateClone()Creates a clone of this collection.java.util.Enumerationelements()Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.WebElementget(int index)Returns theWebElementobject with the given index.intgetChildCount()Returns the number of child display units.WebDisplayUnitsgetChildUnits()Returns the collection of child display units, or null if the object is not a collection.WebElementgetItemByKey(int key)Returns aWebElementobject with the given key, if it exists.WebObjectInfogetSource()booleanisEmpty()Returns true if there are no elements in this collection, false if there are one or more elements in the collection.intkeyOf(WebElement element)Returns the key of the given element within the collection.voidremove(int index)Removes theWebElementobject with the given index from the collection, and returns the removed element.voidremove(WebElement element)Removes the givenWebElementobject from the collection.voidremoveItemByID(java.lang.String elementID)voidremoveItemByKey(int key)Removes theWebElementobject with the given key from the collection, and returns the removed element.booleanreturnedAllAvailableData()voidsetSource(WebObjectInfo _source)intsize()Returns the number of elements currently in the collection.
-
-
-
Method Detail
-
add
WebElement add(java.lang.String elementID) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
Creates a newWebElementobject using the given parameters, adds it to the elements collection, and returns the newly created object.- Parameters:
elementID- The ID of the element to add.- Returns:
- The newly added
WebElementobject. - Throws:
java.lang.IllegalArgumentException- Thrown if the element ID does not come from the source object of the collection (if the source object is set).java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
add
WebElement add(java.lang.String elementID, java.lang.String displayName) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
Creates a newWebElementobject using the given parameters, adds it to the elements collection, and returns the newly created object.- Parameters:
elementID- The ID of the element to add.displayName- The display name to assign to the element.- Returns:
- The newly added
WebElementobject. - Throws:
java.lang.IllegalArgumentException- Thrown if the element ID does not come from the source object of the collection (if the source object is set).java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
add
WebElement add(java.lang.String elementID, java.lang.String displayName, java.lang.String displayForm) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
Creates a newWebElementobject using the given parameters, adds it to the elements collection, and returns the newly created object.- Parameters:
elementID- The ID of the element to add.displayName- The display name to assign to the element.displayForm- The display forms to assign to the element.- Returns:
- The newly added
WebElementobject. - Throws:
java.lang.IllegalArgumentException- Thrown if the element ID does not come from the source object of the collection (if the source object is set).java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
get
WebElement get(int index) throws java.lang.IndexOutOfBoundsException
Returns theWebElementobject with the given index.- Parameters:
index- The index of the element in the collection.- Returns:
- The
WebElementobject corresponding to the given index in the collection. - Throws:
java.lang.IndexOutOfBoundsException- Thrown if the given index is out of the bounds of the collection.
-
getItemByKey
WebElement getItemByKey(int key) throws java.lang.IllegalArgumentException
Returns aWebElementobject with the given key, if it exists.- Parameters:
key- The key of the element to search for in the collection.- Returns:
- A
WebElementobject in the collection corresponding to the given key. - Throws:
java.lang.IllegalArgumentException- Thrown if the key does not exist in the collection.
-
remove
void remove(int index) throws java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsExceptionRemoves theWebElementobject with the given index from the collection, and returns the removed element.- Parameters:
index- The index of the element in the collection to remove.- Throws:
java.lang.IndexOutOfBoundsException- Thrown if the given index is out of the bounds of the collection.java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
removeItemByKey
void removeItemByKey(int key) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentExceptionRemoves theWebElementobject with the given key from the collection, and returns the removed element.- Parameters:
key- The key of the element to search for in the collection.- Throws:
java.lang.IllegalArgumentException- Thrown if the key does not exist in the collection.java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
remove
void remove(WebElement element) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Removes the givenWebElementobject from the collection. Returns true if the operation succeeds.- Parameters:
element- TheWebElementobject to remove from the collection.- Throws:
java.lang.IllegalArgumentException- Thrown if the element does not exist in the collection.java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
removeItemByID
void removeItemByID(java.lang.String elementID) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException- Throws:
java.lang.UnsupportedOperationExceptionjava.lang.IllegalArgumentException- Since:
- MicroStrategy Web 9.0.0
-
clear
void clear() throws java.lang.UnsupportedOperationExceptionRemoves all elements from the collection.- Throws:
java.lang.UnsupportedOperationException- Thrown if the collection is read-only.
-
isEmpty
boolean isEmpty()
Returns true if there are no elements in this collection, false if there are one or more elements in the collection.- Returns:
- Whether the collection is empty.
-
size
int size()
Returns the number of elements currently in the collection.- Returns:
- The current number of elements in the collection.
-
containsKey
boolean containsKey(int key)
Returns true if the given key exists in the collection, false if it does not.- Parameters:
key- The key whose existence we need to verify.- Returns:
- Whether the given key exists in the collection.
-
keyOf
int keyOf(WebElement element) throws java.lang.IllegalArgumentException
Returns the key of the given element within the collection.- Parameters:
element- TheWebElementobject to return the key of.- Returns:
- int The key of the object.
- Throws:
java.lang.IllegalArgumentException- Thrown if the element's key cannot be determined, or the element is null.
-
elements
java.util.Enumeration elements()
Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.- Returns:
- An Enumeration which allows iteration through the collection.
-
getChildCount
int getChildCount()
Returns the number of child display units.- Returns:
- The number of child display units.
-
returnedAllAvailableData
boolean returnedAllAvailableData()
-
getChildUnits
WebDisplayUnits getChildUnits() throws WebObjectsException
Returns the collection of child display units, or null if the object is not a collection. Note that several display units are actually collections of display units as well.- Returns:
- The collection of child display units of this instance, or null if this object is not a collection.
- Throws:
WebObjectsException
-
createClone
WebElements createClone()
Creates a clone of this collection. Unlike the standard Java clone method, the clone is a deep clone, in that the list of elements will be separate between the two instances of the WebElements collections. This method is normally used by code that has a need to rollback the state of elements collections.- Since:
- MicroStrategy Web 9.0.0
-
buildShortXML
void buildShortXML(WebXMLBuilder builder)
-
setSource
void setSource(WebObjectInfo _source)
-
getSource
WebObjectInfo getSource()
-
-