com.businessobjects.query
Interface Rank

All Superinterfaces:
ConditionBase

public interface Rank
extends ConditionBase

Applying ranking to a query permits the results of the query to be filtered in such a way that only those results are returned which are related to the highest and lowest values of a defined data field.

Example: Applying ranking to the Query.

        QuerySpecification boQuerySpec = QuerySpecification.Factory.newInstance();
        Query boQuery1 = Query.Factory.newInstance();
        QueryObject[] boQueryResultObjects = new QueryObject[2];
        boQueryResultObjects[0] = QueryObject.Factory.newInstance();
        boQueryResultObjects[1] = QueryObject.Factory.newInstance();
        boQueryResultObjects[0].setKey((String)dimensionKeys.get(0));
        boQueryResultObjects[1].setKey((String)measureKeys.get(0));
        QueryObject boBasedOnObject = QueryObject.Factory.newInstance();
        boBasedOnObject.setKey((String)measureKeys.get(0));
        QueryObject boFilteredObject = QueryObject.Factory.newInstance();
        boFilteredObject.setKey((String)dimensionKeys.get(0));

        Rank rank = Rank.Factory.newInstance();
        rank.setBasedOnObject(boBasedOnObject);
        rank.setFilteredObject(boFilteredObject);
        // Specifies the Top 1 ranked results
        rank.setPodium(Podium.TOP);
        rank.setSize(1);
        ConditionBase[] boConditionBase = new ConditionBase[1];
        boConditionBase[0] = rank;
        QueryCondition boQueryCondition = QueryCondition.Factory.newInstance();
        boQueryCondition.setItemArray(boConditionBase);
        boQuery1.setQueryCondition(boQueryCondition);
        // Add the array of result objects to the Query.
        boQuery1.setQueryResultArray(boQueryResultObjects);
        // Add the Query to the QuerySpecification
        boQuerySpec.setQueryBase(boQuery1);
 

See Also:
Podium

Nested Class Summary
static class Rank.Factory
          A class with methods for creating instances of the Rank type.
 
Field Summary
static org.apache.xmlbeans.SchemaType type
          Internal Use Only.
 
Method Summary
 QueryObject addNewBasedOnObject()
          Appends and returns a new empty "BasedOnObject" element
 QueryObject addNewFilteredObject()
          Appends and returns a new empty "FilteredObject" element
 QueryObject addNewForEachObject()
          Appends and returns a new empty value (as xml) as the last ForEachObject element
 Prompt addNewPromptSize()
          Appends and returns a new empty PromptSize element
 QueryCondition addNewQueryCondition()
          Appends and returns a new empty QueryCondition element
 QueryObject getBasedOnObject()
           Gets the universe object that the ranking is based on.
 QueryObject getFilteredObject()
           Gets the universe object that is filtered.
 QueryObject[] getForEachObjectArray()
           Gets the ForEach dimension for the query.
 QueryObject getForEachObjectArray(int i)
           Gets the ForEach dimension at a specified index.
 Podium.Enum getPodium()
           Gets the Podium instance which specifies whether to return the "Top" n ranked results, or the "Bottom" n.
 Prompt getPromptSize()
           Gets the Prompt that gives the number of records that are returned.
 boolean getPromptSizeActive()
          Return true if the rank size will be given by the getPromptSize method.
 QueryCondition getQueryCondition()
           Gets the condition used in the ranking.
 int getSize()
           Gets the number of records that are returned.
 QueryObject insertNewForEachObject(int i)
          Inserts and returns a new empty value (as xml) as the ith ForEachObject element
 boolean isSetPromptSize()
          Checks if the "PromptSize" element has been set.
 boolean isSetQueryCondition()
          Checks if the QueryCondition element has been set.
 boolean isSetSize()
          Checks if the Size attribute has been set.
 void removeForEachObject(int i)
          Removes the ForEachObject element at the specified index position
 void setBasedOnObject(QueryObject basedOnObject)
           Sets the universe object that the ranking is based on.
 void setFilteredObject(QueryObject filteredObject)
           Sets the universe object to filter.
 void setForEachObjectArray(int i, QueryObject forEachObject)
           Sets the ForEach dimension at a specified index.
 void setForEachObjectArray(QueryObject[] forEachObjectArray)
           Sets the ForEach dimension for the query.
 void setPodium(Podium.Enum podium)
          Sets the Podium attribute
 void setPromptSize(Prompt promptSize)
           Sets the Prompt that gives the number of records that are returned.
 void setPromptSizeActive(boolean promptSizeActive)
          When called with true, it will cause the rank size to be given by the getPromptSize method.
 void setQueryCondition(QueryCondition queryCondition)
           Sets the condition used in the ranking.
 void setSize(int size)
           Sets the number of records that are returned.
 int sizeOfForEachObjectArray()
          Returns number of "ForEachObject" element
 void unsetPromptSize()
          Deletes or unsets the PromptSize element
 void unsetQueryCondition()
          Deletes or unsets the QueryCondition element
 void unsetSize()
          Deletes or unsets the Size attribute
 Podium xgetPodium()
          Internal Use Only.
 org.apache.xmlbeans.XmlBoolean xgetPromptSizeActive()
          Internal Use Only.
 org.apache.xmlbeans.XmlInt xgetSize()
          Internal Use Only.
 void xsetPodium(Podium podium)
          Internal Use Only.
 void xsetPromptSizeActive(org.apache.xmlbeans.XmlBoolean promptSizeActive)
          Internal Use Only.
 void xsetSize(org.apache.xmlbeans.XmlInt size)
          Internal Use Only.
 
Methods inherited from interface com.businessobjects.query.ConditionBase
getID, isSetID, setID, unsetID, xgetID, xsetID
 

Field Detail

type

static final org.apache.xmlbeans.SchemaType type

Internal Use Only.

Method Detail

getFilteredObject

QueryObject getFilteredObject()

Gets the universe object that is filtered. For example, if you want the Top 10 cities ranked by sales revenue, the "filtered object" would be "city".

Returns:
the universe object that is filtered

setFilteredObject

void setFilteredObject(QueryObject filteredObject)

Sets the universe object to filter. For example, if you want the Top 10 cities ranked by sales revenue, the "filtered object" would be "city".

Parameters:
filteredObject - the universe object to filter

addNewFilteredObject

QueryObject addNewFilteredObject()
Appends and returns a new empty "FilteredObject" element

Returns:
a new empty "FilteredObject" element

getBasedOnObject

QueryObject getBasedOnObject()

Gets the universe object that the ranking is based on. For example, if you want the Top 10 cities ranked by sales revenue, the "based on object" would be "sales revenue".

Returns:
the universe object that the ranking is based on

setBasedOnObject

void setBasedOnObject(QueryObject basedOnObject)

Sets the universe object that the ranking is based on. For example, if you want the Top 10 cities ranked by sales revenue, the "based on object" would be "sales revenue".

Parameters:
basedOnObject - the universe object that the ranking is based on

addNewBasedOnObject

QueryObject addNewBasedOnObject()
Appends and returns a new empty "BasedOnObject" element

Returns:
a new empty "BasedOnObject" element

getForEachObjectArray

QueryObject[] getForEachObjectArray()

Gets the ForEach dimension for the query. For example, if you want the Top 10 cities ranked by sales revenue for every year, the ForEach dimension would be "year". This query would return the top 10 cities for every year (for example, the top 10 cities for 1999, the top 10 cities for 2000, etc.).

Returns:
the ForEach dimension at a specified index.

getForEachObjectArray

QueryObject getForEachObjectArray(int i)

Gets the ForEach dimension at a specified index. For example, if you want the Top 10 cities ranked by sales revenue for every year, the ForEach dimension would be "year". This query would return the top 10 cities for every year (for example, the top 10 cities for 1999, the top 10 cities for 2000, etc.).

Parameters:
i - the array index containing the ForEach dimension

sizeOfForEachObjectArray

int sizeOfForEachObjectArray()
Returns number of "ForEachObject" element

Returns:
the size of the ForEachObject array

setForEachObjectArray

void setForEachObjectArray(QueryObject[] forEachObjectArray)

Sets the ForEach dimension for the query. For example, if you want the Top 10 cities ranked by sales revenue for every year, the ForEach dimension would be "year". This query would return the top 10 cities for every year (for example, the top 10 cities for 1999, the top 10 cities for 2000, etc.).

Parameters:
forEachObject - the ForEach dimension

setForEachObjectArray

void setForEachObjectArray(int i,
                           QueryObject forEachObject)

Sets the ForEach dimension at a specified index. For example, if you want the Top 10 cities ranked by sales revenue for every year, the ForEach dimension would be "year". This query would return the top 10 cities for every year (for example, the top 10 cities for 1999, the top 10 cities for 2000, etc.).

Parameters:
i - the array index where to store the ForEach dimension
value - the ForEach dimension to store

insertNewForEachObject

QueryObject insertNewForEachObject(int i)
Inserts and returns a new empty value (as xml) as the ith ForEachObject element

Parameters:
i - the index of the ForEachObject element
Returns:
a new empty value (as xml) as the ith ForEachObject element

addNewForEachObject

QueryObject addNewForEachObject()
Appends and returns a new empty value (as xml) as the last ForEachObject element

Returns:
a new empty value (as xml) as the last "ForEachObject" element

removeForEachObject

void removeForEachObject(int i)
Removes the ForEachObject element at the specified index position

Parameters:
i - the index of the ForEachObject element

getQueryCondition

QueryCondition getQueryCondition()

Gets the condition used in the ranking. For example, if you want the Top 10 cities in the United States ranked by sales revenue, then you would create a query condition where only cities in the United States are used in the ranking.

Returns:
the condition used in the ranking

isSetQueryCondition

boolean isSetQueryCondition()
Checks if the QueryCondition element has been set.

Returns:
true if the QueryCondition element is set, otherwise false

setQueryCondition

void setQueryCondition(QueryCondition queryCondition)

Sets the condition used in the ranking. For example, if you want the Top 10 cities in the United States ranked by sales revenue, then you would create a query condition where only cities in the United States are used in the ranking.

Parameters:
queryCondition - the condition used in the ranking

addNewQueryCondition

QueryCondition addNewQueryCondition()
Appends and returns a new empty QueryCondition element

Returns:
a new empty QueryCondition element

unsetQueryCondition

void unsetQueryCondition()
Deletes or unsets the QueryCondition element


getPromptSize

Prompt getPromptSize()

Gets the Prompt that gives the number of records that are returned.

Returns:
the Prompt that gives the number of records that are returned

isSetPromptSize

boolean isSetPromptSize()
Checks if the "PromptSize" element has been set.

Returns:
true if the PromptSize element is set, otherwise false

setPromptSize

void setPromptSize(Prompt promptSize)

Sets the Prompt that gives the number of records that are returned.

Parameters:
promptSize - the Prompt that gives the number of records that are returned

addNewPromptSize

Prompt addNewPromptSize()
Appends and returns a new empty PromptSize element

Returns:
a new empty PromptSize element

unsetPromptSize

void unsetPromptSize()
Deletes or unsets the PromptSize element


getPromptSizeActive

boolean getPromptSizeActive()
Return true if the rank size will be given by the getPromptSize method. Return false if the rank size will be given by the getSize method.

Returns:
true if the rank size will be given by the getPromptSize method, false if the rank size will be given by the getSize method.

xgetPromptSizeActive

org.apache.xmlbeans.XmlBoolean xgetPromptSizeActive()

Internal Use Only.


setPromptSizeActive

void setPromptSizeActive(boolean promptSizeActive)
When called with true, it will cause the rank size to be given by the getPromptSize method. When called with false, it will cause the rank size to be given by the getSize method.

Parameters:
promptSizeActive - set to true if the rank size will be given by the getPromptSize method, otherwise false

xsetPromptSizeActive

void xsetPromptSizeActive(org.apache.xmlbeans.XmlBoolean promptSizeActive)

Internal Use Only.


getSize

int getSize()

Gets the number of records that are returned. For example, if you want the Top 10 cities ranked by sales revenue, the "Size" would be "10".

Returns:
the number of records that are returned

xgetSize

org.apache.xmlbeans.XmlInt xgetSize()

Internal Use Only.


isSetSize

boolean isSetSize()
Checks if the Size attribute has been set.

Returns:
true if the Size element is set, otherwise false

setSize

void setSize(int size)

Sets the number of records that are returned. For example, if you want the Top 10 cities ranked by sales revenue, the "Size" would be "10".

Parameters:
size - the number of records that are returned

xsetSize

void xsetSize(org.apache.xmlbeans.XmlInt size)

Internal Use Only.


unsetSize

void unsetSize()
Deletes or unsets the Size attribute


getPodium

Podium.Enum getPodium()

Gets the Podium instance which specifies whether to return the "Top" n ranked results, or the "Bottom" n.

Returns:
the Podium instance for this Rank instance

xgetPodium

Podium xgetPodium()

Internal Use Only.


setPodium

void setPodium(Podium.Enum podium)
Sets the Podium attribute

Parameters:
podium - the Podium instance for this Rank instance

xsetPodium

void xsetPodium(Podium podium)

Internal Use Only.