com.microstrategy.web.objects.SimpleList |
![]() |
The SimpleList interface is returned from several of the objects in the Web Objects layer. This interface will allow the user to add, remove, and examine the objects in the given collection.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
add(Object element)
Adds the given object to the collection.
| ||||||||||
abstract void | addAll(SimpleList simpleList) | ||||||||||
abstract void |
clear()
Clears all items from the collection.
| ||||||||||
abstract boolean | contains(Object object) | ||||||||||
abstract Enumeration |
elements()
Returns a java.util.Enumeration containing the items inside this list.
| ||||||||||
abstract boolean |
isEmpty()
Returns true if the collection is empty, false otherwise.
| ||||||||||
abstract boolean |
isReadOnly()
Returns true if the collection is read-only, false if it can be modified.
| ||||||||||
abstract Object |
item(int index)
Returns the item in the list with the given index.
| ||||||||||
abstract void |
remove(int index)
Removes the item with the given index from the list.
| ||||||||||
abstract boolean |
remove(Object obj)
Removes from the list, the first object which equals the object passed as argument.
| ||||||||||
abstract int |
size()
Returns the current size of the list.
| ||||||||||
abstract void |
sort(Comparator c)
Sorts the collection.
|
Adds the given object to the collection. It will be added to the end of the list. Note that this could fail either because the object is read-only, or because the creating object has constrained the list to only hold a certain type of object.
element | The object to add to the collection. |
---|
UnsupportedOperationException | Thrown if the list is read-only. |
---|---|
ClassCastException | Thrown if the object given is of an inappropriate type. |
Clears all items from the collection. Throws an UnsupportedOperationException if the object is read-only.
UnsupportedOperationException | Thrown if the list is read-only. |
---|
Returns a java.util.Enumeration containing the items inside this list.
Returns true if the collection is empty, false otherwise.
Returns true if the collection is read-only, false if it can be modified.
Returns the item in the list with the given index.
index | The index of the item in the collection to return. |
---|
IndexOutOfBoundsException | Thrown if no item in the collection has the given index. |
---|
Removes the item with the given index from the list. This will cause a shifting of indices of items in the list which are after the removed item.
index | The index of the item in the collection to remove. |
---|
IndexOutOfBoundsException | Thrown if no item in the collection has the given index. |
---|---|
UnsupportedOperationException | Thrown if the list is designated as read-only. |
Removes from the list, the first object which equals the object passed as argument. equals(java.lang.Object)
is used to test the equality of objects. This will cause a shifting of indices of items in the list which are after the removed item.
If the list does not contain the object passed, it would remain unchanged.
obj | The object to remove. |
---|
UnsupportedOperationException | Thrown if the list is designated as read-only. |
---|
Returns the current size of the list.
Sorts the collection. Comparator is optional.