Interface SimpleList

  • All Known Implementing Classes:
    SimpleListObj

    public interface 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.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(java.lang.Object element)
      Adds the given object to the collection.
      void addAll​(SimpleList simpleList)  
      void clear()
      Clears all items from the collection.
      boolean contains​(java.lang.Object object)  
      java.util.Enumeration elements()
      Returns a java.util.Enumeration containing the items inside this list.
      boolean isEmpty()
      Returns true if the collection is empty, false otherwise.
      boolean isReadOnly()
      Returns true if the collection is read-only, false if it can be modified.
      java.lang.Object item​(int index)
      Returns the item in the list with the given index.
      void remove​(int index)
      Removes the item with the given index from the list.
      boolean remove​(java.lang.Object obj)
      Removes from the list, the first object which equals the object passed as argument.
      int size()
      Returns the current size of the list.
      void sort​(java.util.Comparator c)
      Sorts the collection.
      java.util.ArrayList toArrayList()
      Return the list as an array list.
    • Method Detail

      • add

        void add​(java.lang.Object element)
          throws java.lang.UnsupportedOperationException,
                 java.lang.ClassCastException
        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:
        java.lang.UnsupportedOperationException - Thrown if the list is read-only.
        java.lang.ClassCastException - Thrown if the object given is of an inappropriate type.
      • clear

        void clear()
            throws java.lang.UnsupportedOperationException
        Clears all items from the collection. Throws an UnsupportedOperationException if the object is read-only.
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the list is read-only.
      • size

        int size()
        Returns the current size of the list.
        Returns:
        The number of items in the list.
      • item

        java.lang.Object item​(int index)
                       throws java.lang.IndexOutOfBoundsException
        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:
        java.lang.IndexOutOfBoundsException - Thrown if no item in the collection has the given index.
      • remove

        void remove​(int index)
             throws java.lang.UnsupportedOperationException,
                    java.lang.IndexOutOfBoundsException
        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:
        java.lang.IndexOutOfBoundsException - Thrown if no item in the collection has the given index.
        java.lang.UnsupportedOperationException - Thrown if the list is designated as read-only.
      • remove

        boolean remove​(java.lang.Object obj)
                throws java.lang.UnsupportedOperationException
        Removes from the list, the first object which equals the object passed as argument. Object.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:
        java.lang.UnsupportedOperationException - Thrown if the list is designated as read-only.
        Since:
        MicroStrategy Web 7.5.2
      • isReadOnly

        boolean isReadOnly()
        Returns true if the collection is read-only, false if it can be modified.
        Returns:
        Whether the collection is read-only.
      • isEmpty

        boolean isEmpty()
        Returns true if the collection is empty, false otherwise.
        Returns:
        Whether the collection is empty.
      • elements

        java.util.Enumeration elements()
        Returns a java.util.Enumeration containing the items inside this list.
        Returns:
        An enumeration of the items inside this list.
      • contains

        boolean contains​(java.lang.Object object)
        Since:
        MicroStrategy Web 7.5.1
      • addAll

        void addAll​(SimpleList simpleList)
        Since:
        MicroStrategy Web 7.5.1
      • sort

        void sort​(java.util.Comparator c)
        Sorts the collection. Comparator is optional.
        Since:
        MicroStrategy Web 7.5.1
      • toArrayList

        java.util.ArrayList toArrayList()
        Return the list as an array list.