public interface

SimpleList

com.microstrategy.web.objects.SimpleList
Known Indirect Subclasses

Class Overview

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.

Summary

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.

Public Methods

public abstract void add (Object element)

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.

Parameters
element The object to add to the collection.
Throws
UnsupportedOperationException Thrown if the list is read-only.
ClassCastException Thrown if the object given is of an inappropriate type.

public abstract void addAll (SimpleList simpleList)

public abstract void clear ()

Clears all items from the collection. Throws an UnsupportedOperationException if the object is read-only.

Throws
UnsupportedOperationException Thrown if the list is read-only.

public abstract boolean contains (Object object)

public abstract Enumeration elements ()

Returns a java.util.Enumeration containing the items inside this list.

Returns
  • An enumeration of the items inside this list.

public abstract boolean isEmpty ()

Returns true if the collection is empty, false otherwise.

Returns
  • Whether the collection is empty.

public abstract boolean isReadOnly ()

Returns true if the collection is read-only, false if it can be modified.

Returns
  • Whether the collection is read-only.

public abstract Object item (int index)

Returns the item in the list with the given index.

Parameters
index The index of the item in the collection to return.
Returns
  • The object which is at the given index in the collection.
Throws
IndexOutOfBoundsException Thrown if no item in the collection has the given index.

public abstract void remove (int 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.

Parameters
index The index of the item in the collection to remove.
Throws
IndexOutOfBoundsException Thrown if no item in the collection has the given index.
UnsupportedOperationException Thrown if the list is designated as read-only.

public abstract boolean remove (Object obj)

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.

Parameters
obj The object to remove.
Returns
  • boolean True if the list contained the object passed and it has been been succesfully removed. False, otherwise.
Throws
UnsupportedOperationException Thrown if the list is designated as read-only.

public abstract int size ()

Returns the current size of the list.

Returns
  • The number of items in the list.

public abstract void sort (Comparator c)

Sorts the collection. Comparator is optional.