Package com.microstrategy.web.objects
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 moveWebTemplateUnit
objects 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 WebTemplateUnit
add(java.lang.Object object)
Adds the given object to the end of the current axis.WebTemplateUnit
add(java.lang.Object object, int beforeKey)
Adds the given object to the end of the current axis, before the object with the given key.void
clear()
Clears allWebTemplateUnit
objects from this axis.void
clear(boolean isDisableOnly)
Clears allWebTemplateUnit
objects from this axis.boolean
contains(WebObjectInfo object)
Returns true if there exists aWebTemplateUnit
object in this axis which represents the givenWebObjectInfo
object.boolean
containsKey(int key)
Returns true if an object with the given key can be found on the axis.boolean
containsMetrics()
Returns true if the metrics collection is on the current axis, false if it is not.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.WebTemplateUnit
get(int index)
Returns theWebTemplateUnit
object within this axis with the given (0-based) index.WebFormatContainer
getFormatContainer()
Get the format container on this axis, which contains the 4 format objects.int
getIndex()
Returns the (1-based) index of this axis.WebTemplateUnit
getItemByKey(int key)
Returns theWebTemplateUnit
object within this axis with the given key.WebSorts
getSorts()
Returns theWebSorts
collection, which allows the user to examine and change the sorting settings on the axis.boolean
isEmpty()
Returns whether the axis is empty.int
keyOf(WebObjectInfo object)
Returns the key of theWebTemplateUnit
object on the current axis corresponding to the givenWebObjectInfo
object.int
keyOfMetrics()
Returns the key of theWebTemplateMetrics
object in the axis.void
remove(int index)
Removes theWebTemplateUnit
object at the given index from the collection.void
remove(int index, boolean isDisableOnly)
Removes theWebTemplateUnit
object at the given index from the collection.void
removeItemByKey(int key)
Removes theWebTemplateUnit
object with the given key from the collection.void
removeItemByKey(int key, boolean isDisableOnly)
Removes theWebTemplateUnit
object with the given key from the collection.int
size()
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 typeWebObjectInfo
orWebTemplateMetrics
. 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 typeWebObjectInfo
orWebTemplateMetrics
, 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 typeWebObjectInfo
orWebTemplateMetrics
. 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 typeWebObjectInfo
orWebTemplateMetrics
, 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 theWebTemplateUnit
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 theWebTemplateUnit
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 theWebTemplateUnit
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 theWebTemplateUnit
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 theWebTemplateUnit
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 theWebTemplateUnit
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 allWebTemplateUnit
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 allWebTemplateUnit
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.
-
contains
boolean contains(WebObjectInfo object)
Returns true if there exists aWebTemplateUnit
object in this axis which represents the givenWebObjectInfo
object.- Parameters:
object
- TheWebObjectInfo
object to find in the collection.- Returns:
- true if there exists a
WebTemplateUnit
object in this axis which represents the givenWebObjectInfo
object, 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 theWebTemplateUnit
object on the current axis corresponding to the givenWebObjectInfo
object.- Parameters:
object
- TheWebObjectInfo
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 theWebTemplateMetrics
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.
-
-