Package com.microstrategy.web.objects
Interface WebAxis
-
public interface WebAxisThe WebAxis interface represents the current state of a single axis on a template. The WebAxis object has many methods to add, remove, or moveWebTemplateUnitobjects to/from the collection, or gather information about the contents of the collection.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebTemplateUnitadd(java.lang.Object object)Adds the given object to the end of the current axis.WebTemplateUnitadd(java.lang.Object object, int beforeKey)Adds the given object to the end of the current axis, before the object with the given key.voidclear()Clears allWebTemplateUnitobjects from this axis.voidclear(boolean isDisableOnly)Clears allWebTemplateUnitobjects from this axis.booleancontains(WebObjectInfo object)Returns true if there exists aWebTemplateUnitobject in this axis which represents the givenWebObjectInfoobject.booleancontainsKey(int key)Returns true if an object with the given key can be found on the axis.booleancontainsMetrics()Returns true if the metrics collection is on the current axis, false if it is not.java.util.Enumerationelements()Returns a java.util.Enumeration which can be used to iterate through the objects on the axis, in left-to-right order.WebTemplateUnitget(int index)Returns theWebTemplateUnitobject within this axis with the given (0-based) index.WebFormatContainergetFormatContainer()Get the format container on this axis, which contains the 4 format objects.intgetIndex()Returns the (1-based) index of this axis.WebTemplateUnitgetItemByKey(int key)Returns theWebTemplateUnitobject within this axis with the given key.WebSortsgetSorts()Returns theWebSortscollection, which allows the user to examine and change the sorting settings on the axis.booleanisEmpty()Returns whether the axis is empty.intkeyOf(WebObjectInfo object)Returns the key of theWebTemplateUnitobject on the current axis corresponding to the givenWebObjectInfoobject.intkeyOfMetrics()Returns the key of theWebTemplateMetricsobject in the axis.voidremove(int index)Removes theWebTemplateUnitobject at the given index from the collection.voidremove(int index, boolean isDisableOnly)Removes theWebTemplateUnitobject at the given index from the collection.voidremoveItemByKey(int key)Removes theWebTemplateUnitobject with the given key from the collection.voidremoveItemByKey(int key, boolean isDisableOnly)Removes theWebTemplateUnitobject with the given key from the collection.intsize()Returns the number of template units on the current axis.
-
-
-
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 typeWebObjectInfoorWebTemplateMetrics. In addition, if the object is of typeWebObjectInfo, 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 typeWebObjectInfo, 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 typeWebTemplateMetrics, 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 typeWebObjectInfoorWebTemplateMetrics, which will be added to this axis.- Returns:
- The
WebTemplateUnitobject 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 typeWebObjectInfoorWebTemplateMetrics. In addition, if the object is of typeWebObjectInfo, 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 typeWebObjectInfo, 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 typeWebTemplateMetrics, 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 typeWebObjectInfoorWebTemplateMetrics, 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
WebTemplateUnitobject 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 theWebTemplateUnitobject within this axis with the given (0-based) index.- Parameters:
index- The index of the object to return.- Returns:
- The
WebTemplateUnitobject 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 theWebTemplateUnitobject within this axis with the given key.- Parameters:
key- The key of the object to return.- Returns:
- The
WebTemplateUnitobject 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.IndexOutOfBoundsExceptionRemoves theWebTemplateUnitobject 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.IndexOutOfBoundsExceptionRemoves theWebTemplateUnitobject 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.IllegalArgumentExceptionRemoves theWebTemplateUnitobject 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.IllegalArgumentExceptionRemoves theWebTemplateUnitobject 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.UnsupportedOperationExceptionClears allWebTemplateUnitobjects from this axis.- Throws:
java.lang.UnsupportedOperationException- Thrown if the axis is designated as read-only.
-
clear
void clear(boolean isDisableOnly) throws java.lang.UnsupportedOperationExceptionClears allWebTemplateUnitobjects 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
WebTemplateUnitobjects 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.
-
contains
boolean contains(WebObjectInfo object)
Returns true if there exists aWebTemplateUnitobject in this axis which represents the givenWebObjectInfoobject.- Parameters:
object- TheWebObjectInfoobject to find in the collection.- Returns:
- true if there exists a
WebTemplateUnitobject in this axis which represents the givenWebObjectInfoobject, else return false.
-
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 theWebTemplateUnitobject on the current axis corresponding to the givenWebObjectInfoobject.- Parameters:
object- TheWebObjectInfoobject 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.IllegalArgumentExceptionReturns the key of theWebTemplateMetricsobject 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
WebTemplateUnitobjects in the collection.
-
getFormatContainer
WebFormatContainer getFormatContainer()
Get the format container on this axis, which contains the 4 format objects.- Returns:
- The
WebFormatContainerobject, which is the container for the 4 format objects.
-
-