public interface

WebElements

com.microstrategy.web.objects.WebElements

Class Overview

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.

Summary

Public Methods
abstract WebElement add(String elementID, String displayName)
Creates a new WebElement object using the given parameters, adds it to the elements collection, and returns the newly created object.
abstract WebElement add(String elementID)
Creates a new WebElement object using the given parameters, adds it to the elements collection, and returns the newly created object.
abstract void buildShortXML(WebXMLBuilder builder)
abstract void clear()
Removes all elements from the collection.
abstract boolean containsKey(int key)
Returns true if the given key exists in the collection, false if it does not.
abstract WebElements createClone()
Creates a clone of this collection.
abstract Enumeration elements()
Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.
abstract WebElement get(int index)
Returns the WebElement object with the given index.
abstract WebDisplayUnits getChildUnits()
Returns the collection of child display units, or null if the object is not a collection.
abstract WebElement getItemByKey(int key)
Returns a WebElement object with the given key, if it exists.
abstract WebObjectInfo getSource()
abstract boolean isEmpty()
Returns true if there are no elements in this collection, false if there are one or more elements in the collection.
abstract int keyOf(WebElement element)
Returns the key of the given element within the collection.
abstract void remove(WebElement element)
Removes the given WebElement object from the collection.
abstract void remove(int index)
Removes the WebElement object with the given index from the collection, and returns the removed element.
abstract void removeItemByID(String elementID)
abstract void removeItemByKey(int key)
Removes the WebElement object with the given key from the collection, and returns the removed element.
abstract void setSource(WebObjectInfo _source)
aggregation
abstract int size()
Returns the number of elements currently in the collection.

Public Methods

public abstract WebElement add (String elementID, String displayName)

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
Throws
IllegalArgumentException Thrown if the element ID does not come from the source object of the collection (if the source object is set).
UnsupportedOperationException Thrown if the collection is read-only.

public abstract WebElement add (String elementID)

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
Throws
IllegalArgumentException Thrown if the element ID does not come from the source object of the collection (if the source object is set).
UnsupportedOperationException Thrown if the collection is read-only.

public abstract void buildShortXML (WebXMLBuilder builder)

public abstract void clear ()

Removes all elements from the collection.

Throws
UnsupportedOperationException Thrown if the collection is read-only.

public abstract 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.

public abstract 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.

public abstract 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.

public abstract WebElement get (int index)

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
IndexOutOfBoundsException Thrown if the given index is out of the bounds of the collection.

public abstract WebDisplayUnits getChildUnits ()

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.

public abstract WebElement getItemByKey (int key)

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
IllegalArgumentException Thrown if the key does not exist in the collection.

public abstract WebObjectInfo getSource ()

public abstract 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.

public abstract int keyOf (WebElement element)

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
IllegalArgumentException Thrown if the element's key cannot be determined, or the element is null.

public abstract void remove (WebElement element)

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
IllegalArgumentException Thrown if the element does not exist in the collection.
UnsupportedOperationException Thrown if the collection is read-only.

public abstract void remove (int index)

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
IndexOutOfBoundsException Thrown if the given index is out of the bounds of the collection.
UnsupportedOperationException Thrown if the collection is read-only.

public abstract void removeItemByID (String elementID)

Throws
IllegalArgumentException
UnsupportedOperationException

public abstract void removeItemByKey (int key)

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
IllegalArgumentException Thrown if the key does not exist in the collection.
UnsupportedOperationException Thrown if the collection is read-only.

public abstract void setSource (WebObjectInfo _source)

aggregation

public abstract int size ()

Returns the number of elements currently in the collection.

Returns
  • The current number of elements in the collection.