Interface WebAxis


  • public interface WebAxis
    The WebAxis interface represents the current state of a single axis on a template. The WebAxis object has many methods to add, remove, or move WebTemplateUnit objects to/from the collection, or gather information about the contents of the collection.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Detail

      • getIndex

        int getIndex()
        Returns the (1-based) index of this axis.
        Returns:
        The index of this axis, from EnumDSSXMLAxisName.
      • add

        WebTemplateUnit add​(java.lang.Object object)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.IllegalArgumentException
        Adds the given object to the end of the current axis. The given object should be of type WebObjectInfo or WebTemplateMetrics. In addition, if the object is of type WebObjectInfo, then only objects which are valid to place on a template may be given. If the specified object exists on *any* axis on the template(including this one), it is first removed from that axis and then added to this axis. For an object of type WebObjectInfo, the given object is considered to exist on an axis if the DSSID and TYPE match (does not need to be the the same instance). For an object of type WebTemplateMetrics, the given object is considered to exist on an axis if containsMetrics() returns true (does not need to the the same instance).
        Parameters:
        object - An object of type WebObjectInfo or WebTemplateMetrics, which will be added to this axis.
        Returns:
        The WebTemplateUnit object corresponding to the given object.
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the template is designated as read-only.
        java.lang.IllegalArgumentException - Thrown if the given argument is not one of the above stated valid types of object.
      • add

        WebTemplateUnit add​(java.lang.Object object,
                            int beforeKey)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.IllegalArgumentException
        Adds the given object to the end of the current axis, before the object with the given key. The given object should be of type WebObjectInfo or WebTemplateMetrics. In addition, if the object is of type WebObjectInfo, then only objects which are valid to place on a template may be given. If the specified object exists on *any* axis (including this one), it is first removed from that axis and then added to this axis. For an object of type WebObjectInfo, the given object is considered to exist on an axis if the DSSID and TYPE match (does not need to be the the same instance). For an object of type WebTemplateMetrics, the given object is considered to exist on an axis if containsMetrics() returns true (does not need to the the same instance).
        Parameters:
        object - An object of type WebObjectInfo or WebTemplateMetrics, which will be added to this axis.
        beforeKey - The key of the object in the axis collection which this object should be placed before.
        Returns:
        The WebTemplateUnit object corresponding to the given object.
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
        java.lang.IllegalArgumentException - Thrown if the given argument is not one of the above stated valid types of object, or if an object with the given key cannot be found on the axis.
      • get

        WebTemplateUnit get​(int index)
                     throws java.lang.IndexOutOfBoundsException
        Returns the WebTemplateUnit object within this axis with the given (0-based) index.
        Parameters:
        index - The index of the object to return.
        Returns:
        The WebTemplateUnit object corresponding to the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - Thrown if the requested index is not within the bounds of the collection.
      • getItemByKey

        WebTemplateUnit getItemByKey​(int key)
                              throws java.lang.IllegalArgumentException
        Returns the WebTemplateUnit object within this axis with the given key.
        Parameters:
        key - The key of the object to return.
        Returns:
        The WebTemplateUnit object corresponding to the given key.
        Throws:
        java.lang.IllegalArgumentException - Thrown if the object with the given key is not found in this axis.
      • remove

        void remove​(int index)
             throws java.lang.UnsupportedOperationException,
                    java.lang.IndexOutOfBoundsException
        Removes the WebTemplateUnit object at the given index from the collection.
        Parameters:
        index - The index of the object to be removed.
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
        java.lang.IndexOutOfBoundsException - Thrown if the requested index is not within the bounds of the collection.
      • remove

        void remove​(int index,
                    boolean isDisableOnly)
             throws java.lang.UnsupportedOperationException,
                    java.lang.IndexOutOfBoundsException
        Removes the WebTemplateUnit object at the given index from the collection.
        Parameters:
        index - The index of the object to be removed.
        isDisableOnly - Indicate if it is a 'disable from grid' or 'remove from grid' for RWD
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
        java.lang.IndexOutOfBoundsException - Thrown if the requested index is not within the bounds of the collection.
      • removeItemByKey

        void removeItemByKey​(int key,
                             boolean isDisableOnly)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.IllegalArgumentException
        Removes the WebTemplateUnit object with the given key from the collection.
        Parameters:
        key - The key of the object to be removed.
        isDisableOnly - Indicate if it is a 'disable from grid' or 'remove from grid' for RWD
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
        java.lang.IllegalArgumentException - Thrown if no object with the given key is found.
      • removeItemByKey

        void removeItemByKey​(int key)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.IllegalArgumentException
        Removes the WebTemplateUnit object with the given key from the collection.
        Parameters:
        key - The key of the object to be removed.
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
        java.lang.IllegalArgumentException - Thrown if no object with the given key is found.
      • clear

        void clear()
            throws java.lang.UnsupportedOperationException
        Clears all WebTemplateUnit objects from this axis.
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
      • clear

        void clear​(boolean isDisableOnly)
            throws java.lang.UnsupportedOperationException
        Clears all WebTemplateUnit objects from this axis.
        Parameters:
        isDisableOnly - Indicate if it is a 'disable from grid' or 'remove from grid' for RWD
        Throws:
        java.lang.UnsupportedOperationException - Thrown if the axis is designated as read-only.
      • size

        int size()
        Returns the number of template units on the current axis.
        Returns:
        The number of WebTemplateUnit objects on this axis.
      • isEmpty

        boolean isEmpty()
        Returns whether the axis is empty.
        Returns:
        True if the axis has no units on it, false if it has one or more.
      • containsKey

        boolean containsKey​(int key)
        Returns true if an object with the given key can be found on the axis.
        Parameters:
        key - The key of the object to search for.
        Returns:
        True if the key can be found in the collection, false otherwise.
      • containsMetrics

        boolean containsMetrics()
        Returns true if the metrics collection is on the current axis, false if it is not.
        Returns:
        True if the metrics collection is found on this axis, false if it is not.
      • keyOf

        int keyOf​(WebObjectInfo object)
           throws java.lang.IllegalArgumentException
        Returns the key of the WebTemplateUnit object on the current axis corresponding to the given WebObjectInfo object.
        Parameters:
        object - The WebObjectInfo object whose key we are seeking.
        Returns:
        The key of the given object on the current axis.
        Throws:
        java.lang.IllegalArgumentException - Thrown if the given object is of the incorrect type, or is not already on the axis.
      • keyOfMetrics

        int keyOfMetrics()
                  throws java.lang.IllegalArgumentException
        Returns the key of the WebTemplateMetrics object in the axis.
        Returns:
        The key of the metrics collection on this axis.
        Throws:
        java.lang.IllegalArgumentException - Thrown if a metrics collection does not exist on the current axis on the axis.
      • elements

        java.util.Enumeration elements()
        Returns a java.util.Enumeration which can be used to iterate through the objects on the axis, in left-to-right order.
        Returns:
        A java.util.Enumeration object, used to iterate through the WebTemplateUnit objects in the collection.
      • getFormatContainer

        WebFormatContainer getFormatContainer()
        Get the format container on this axis, which contains the 4 format objects.
        Returns:
        The WebFormatContainer object, which is the container for the 4 format objects.
      • getSorts

        WebSorts getSorts()
        Returns the WebSorts collection, which allows the user to examine and change the sorting settings on the axis.
        Returns:
        A WebSorts object which can be used to gather information about and change the settings of the sorts on the axis.