Interface WebElements


  • public interface WebElements
    The WebElements interface represents a collection of WebElement objects. 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 as WebElementsObjectNode, WebElementsPrompt or WebElementSource.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      WebElement add​(java.lang.String elementID)
      Creates a new WebElement object using the given parameters, adds it to the elements collection, and returns the newly created object.
      WebElement add​(java.lang.String elementID, java.lang.String displayName)
      Creates a new WebElement object using the given parameters, adds it to the elements collection, and returns the newly created object.
      WebElement add​(java.lang.String elementID, java.lang.String displayName, java.lang.String displayForm)
      Creates a new WebElement object using the given parameters, adds it to the elements collection, and returns the newly created object.
      void buildShortXML​(WebXMLBuilder builder)  
      void clear()
      Removes all elements from the collection.
      boolean containsKey​(int key)
      Returns true if the given key exists in the collection, false if it does not.
      WebElements createClone()
      Creates a clone of this collection.
      java.util.Enumeration elements()
      Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.
      WebElement get​(int index)
      Returns the WebElement object with the given index.
      int getChildCount()
      Returns the number of child display units.
      WebDisplayUnits getChildUnits()
      Returns the collection of child display units, or null if the object is not a collection.
      WebElement getItemByKey​(int key)
      Returns a WebElement object with the given key, if it exists.
      WebObjectInfo getSource()  
      boolean isEmpty()
      Returns true if there are no elements in this collection, false if there are one or more elements in the collection.
      int keyOf​(WebElement element)
      Returns the key of the given element within the collection.
      void remove​(int index)
      Removes the WebElement object with the given index from the collection, and returns the removed element.
      void remove​(WebElement element)
      Removes the given WebElement object from the collection.
      void removeItemByID​(java.lang.String elementID)  
      void removeItemByKey​(int key)
      Removes the WebElement object with the given key from the collection, and returns the removed element.
      boolean returnedAllAvailableData()  
      void setSource​(WebObjectInfo _source)  
      int size()
      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 new WebElement object 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 WebElement object.
        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 new WebElement object 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 WebElement object.
        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 new WebElement object 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 WebElement object.
        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 the WebElement object with the given index.
        Parameters:
        index - The index of the element in the collection.
        Returns:
        The WebElement object 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 a WebElement object with the given key, if it exists.
        Parameters:
        key - The key of the element to search for in the collection.
        Returns:
        A WebElement object 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.IndexOutOfBoundsException
        Removes the WebElement object 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.IllegalArgumentException
        Removes the WebElement object 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 given WebElement object from the collection. Returns true if the operation succeeds.
        Parameters:
        element - The WebElement object 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.UnsupportedOperationException
        java.lang.IllegalArgumentException
        Since:
        MicroStrategy Web 9.0.0
      • clear

        void clear()
            throws java.lang.UnsupportedOperationException
        Removes 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 - The WebElement object 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