public interface

WebSorts

com.microstrategy.web.objects.WebSorts

Class Overview

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.

Summary

Public Methods
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 WebSort add(int sortType)
Create a new sort object according to the specified type, and add it at the end of this collection.
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.

Public Methods

public 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.

Parameters
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.
Returns
Throws
IllegalArgumentException Thrown if sortType is not from EnumDSSXMLSortType.
UnsupportedOperationException Thrown if sortType is EnumDSSXMLSortType.DssXmlSortValue, which currently is not supported.

public abstract WebSort add (int sortType)

Create a new sort object according to the specified type, and add it at the end of this collection.

Parameters
sortType The type of sort object to add, values from EnumDSSXMLSortType
Returns
Throws
IllegalArgumentException Thrown if sortType is not from EnumDSSXMLSortType.
UnsupportedOperationException Thrown if sortType is EnumDSSXMLSortType.DssXmlSortValue, which currently is not supported.

public abstract void clear ()

Remove all sort objects in this collection.

public abstract boolean containsKey (int key)

Returns whether this collection has a sort object whose key equals the input parameter.

Parameters
key The key of the sort object to check whether in this collection.
Returns
  • True when there is a sort object whose key equals the input parameter, else false.

public abstract Enumeration elements ()

Returns an Enumeration of the sort objects inside this collection.

Returns
  • An Enumeration of the sort objects inside this collection.

public abstract WebSort get (int index)

Returns the sort object in this collection according to the index (0-based).

Parameters
index The index of the sort object in the collection (0-based).
Returns
  • the sort object in this colleciton according to the index.
Throws
IndexOutOfBoundsException Thrown when the index is less than 0 or greater or equals to the size of the collection.

public abstract WebSort getItemByKey (int key)

Returns the sort object in this collection whose key equals the input parameter.

Parameters
key The key of the sort object to be returned.
Returns
  • The sort object in this collection whose key equals the input parameter.
Throws
IllegalArgumentException Thrown if there is not sort object in this collection has the specified key.

public abstract boolean getRespectParent ()

Returns the Respect Parent flag

public abstract boolean isEmpty ()

Returns whether this collection is empty.

Returns
  • True when this collection has no sort object inside, else false.

public abstract void move (int fromPosition, int toPosition)

Move sort object specified by fromPosition to the toPosition. This operation will affect the N-key sort order.

Parameters
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.
Throws
IllegalArgumentException Thrown when the any input parameter (fromPosition or toPosition) is less than 1 or greater than the size of this collection.

public abstract void remove (WebObjectInfo oi)

Removes all sorts associated with the given object

Parameters
oi Object

public abstract void remove (int index)

Remove the sort object, specified by the index, from this collection.

Parameters
index The index of the sort object in the collection (0-based).
Throws
IndexOutOfBoundsException Thrown when the index is less than 0 or greater or equals to the size of the collection.

public abstract void removeItemByKey (int key)

Remove the sort object, whose key equals the input parameter, from this collection.

Parameters
key The key of the sort object to be removed.
Throws
IllegalArgumentException Thrown if there is not sort object in this collection has the specified key.

public abstract void removeMetricSorts ()

public abstract void setRespectParent (boolean value)

Sets the Respect Parent flag

Parameters
value value

public abstract int size ()

Returns the size of this collection.

Returns
  • The size of this collection.