com.microstrategy.web.objects.WebSorts |
This interface represents a collection of sort objects. The order of sort objects in this
collection affect the order of applying these sort objects. A sort object appears before another sort
object, then it will be applied before another sort object. And only the results which are equivalent for
the first sort will be affected by the second sort. This is so called N-key sorting. All kinds of sort objects only can be
created from this interface, when add() is called. All possible types of sort object can be created are listed in
EnumDSSXMLSortType
. Sort object of type EnumDSSXMLSortType.DssXmlSortSubtotalsPosition and
EnumDSSXMLSortType.DssXmlSortGroupByMetric will be represented by WebSort
interface. Sort object of type
EnumDSSXMLSortType.DssXmlSortAttributeDefault, EnumDSSXMLSortType.DssXmlSortGroupBySubtotal,
EnumDSSXMLSortType.DssXmlSortDimensionDefault, EnumDSSXMLSortType.DssXmlSortConsolidationDefault
and EnumDSSXMLSortType.DssXmlSortCustomGroupDefault are represented by WebDefaultSort
. Sort object of type
EnumDSSXMLSortType.DssXmlSortAttributeForm and EnumDSSXMLSortType.DssXmlSortDimensionForm are represented by
WebFormSort
. Sort object of type EnumDSSXMLSortType.DssXmlSortMetric is represented by WebMetricSort
.
Sort objects of type EnumDSSXMLSortType.DssXmlSortMetricHierarchical are represented by WebMetricHierarchicalSort
.
Currently we do not support EnumDSSXMLSortType.DssXmlSortValue.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract WebSort |
add(int sortType)
Create a new sort object according to the specified type, and add it at the end of this collection.
| ||||||||||
abstract WebSort |
add(int sortType, int beforeKey)
Create a new sort object according to the specified type, and add it before the existing object whose key equals the beforeKey.
| ||||||||||
abstract void |
clear()
Remove all sort objects in this collection.
| ||||||||||
abstract boolean |
containsKey(int key)
Returns whether this collection has a sort object whose key equals the input parameter.
| ||||||||||
abstract Enumeration |
elements()
Returns an Enumeration of the sort objects inside this collection.
| ||||||||||
abstract WebSort |
get(int index)
Returns the sort object in this collection according to the index (0-based).
| ||||||||||
abstract WebSort |
getItemByKey(int key)
Returns the sort object in this collection whose key equals the input parameter.
| ||||||||||
abstract boolean |
getRespectParent()
Returns the Respect Parent flag
| ||||||||||
abstract boolean |
isEmpty()
Returns whether this collection is empty.
| ||||||||||
abstract void |
move(int fromPosition, int toPosition)
Move sort object specified by fromPosition to the toPosition.
| ||||||||||
abstract void |
remove(WebObjectInfo oi)
Removes all sorts associated with the given object
| ||||||||||
abstract void |
remove(int index)
Remove the sort object, specified by the index, from this collection.
| ||||||||||
abstract void |
removeItemByKey(int key)
Remove the sort object, whose key equals the input parameter, from this collection.
| ||||||||||
abstract void | removeMetricSorts() | ||||||||||
abstract void |
setRespectParent(boolean value)
Sets the Respect Parent flag
| ||||||||||
abstract int |
size()
Returns the size of this collection.
|
Create a new sort object according to the specified type, and add it at the end of this collection.
sortType | The type of sort object to add, values from EnumDSSXMLSortType |
---|
WebDefaultSort
,
WebFormSort
, WebMetricSort
or WebMetricHierarchicalSort
) may be returned. Should cast the return
object to the specific interface to access the more specific information for that type.
IllegalArgumentException | Thrown if sortType is not from EnumDSSXMLSortType . |
---|---|
UnsupportedOperationException | Thrown if sortType is EnumDSSXMLSortType.DssXmlSortValue, which currently is not supported. |
Create a new sort object according to the specified type, and add it before the existing object whose key equals the beforeKey.
sortType | The type of sort object to add, values from EnumDSSXMLSortType |
---|---|
beforeKey | The key of a reference sort object, which the newly created sort object will be inseart before. |
WebDefaultSort
,
WebFormSort
, WebMetricSort
or WebMetricHierarchicalSort
) may be returned. Should cast the return
object to the specific interface to access the more specific information for that type.IllegalArgumentException | Thrown if sortType is not from EnumDSSXMLSortType . |
---|---|
UnsupportedOperationException | Thrown if sortType is EnumDSSXMLSortType.DssXmlSortValue, which currently is not supported. |
Remove all sort objects in this collection.
Returns whether this collection has a sort object whose key equals the input parameter.
key | The key of the sort object to check whether in this collection. |
---|
Returns an Enumeration of the sort objects inside this collection.
Returns the sort object in this collection according to the index (0-based).
index | The index of the sort object in the collection (0-based). |
---|
IndexOutOfBoundsException | Thrown when the index is less than 0 or greater or equals to the size of the collection. |
---|
Returns the sort object in this collection whose key equals the input parameter.
key | The key of the sort object to be returned. |
---|
IllegalArgumentException | Thrown if there is not sort object in this collection has the specified key. |
---|
Returns the Respect Parent flag
Returns whether this collection is empty.
Move sort object specified by fromPosition to the toPosition. This operation will affect the N-key sort order.
fromPosition | The position of the sort object, which will be moved. This is 1-based. The position of the sort object can be obtained by calling WebSort.getPosition(). |
---|---|
toPosition | The position where the object will be moved to. |
IllegalArgumentException | Thrown when the any input parameter (fromPosition or toPosition) is less than 1 or greater than the size of this collection. |
---|
Remove the sort object, specified by the index, from this collection.
index | The index of the sort object in the collection (0-based). |
---|
IndexOutOfBoundsException | Thrown when the index is less than 0 or greater or equals to the size of the collection. |
---|
Remove the sort object, whose key equals the input parameter, from this collection.
key | The key of the sort object to be removed. |
---|
IllegalArgumentException | Thrown if there is not sort object in this collection has the specified key. |
---|
Sets the Respect Parent flag
value | value |
---|
Returns the size of this collection.