|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Rank
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);
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 |
|---|
static final org.apache.xmlbeans.SchemaType type
Internal Use Only.
| Method Detail |
|---|
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".
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".
filteredObject - the universe object to filterQueryObject addNewFilteredObject()
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".
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".
basedOnObject - the universe object that the ranking is based onQueryObject addNewBasedOnObject()
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.).
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.).
i - the array index containing the ForEach dimensionint sizeOfForEachObjectArray()
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.).
forEachObject - the ForEach dimension
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.).
i - the array index where to store the ForEach dimensionvalue - the ForEach dimension to storeQueryObject insertNewForEachObject(int i)
i - the index of the ForEachObject element
QueryObject addNewForEachObject()
void removeForEachObject(int i)
i - the index of the ForEachObject elementQueryCondition 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.
boolean isSetQueryCondition()
true if the QueryCondition element is set, otherwise falsevoid 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.
queryCondition - the condition used in the rankingQueryCondition addNewQueryCondition()
void unsetQueryCondition()
Prompt getPromptSize()
Gets the Prompt that gives the number of records that are returned.
Prompt that gives the number of records that are returnedboolean isSetPromptSize()
true if the PromptSize element is set, otherwise false
void setPromptSize(Prompt promptSize)
Sets the Prompt that gives the number of records that are returned.
promptSize - the Prompt that gives the number of records that are returnedPrompt addNewPromptSize()
void unsetPromptSize()
boolean getPromptSizeActive()
getPromptSize method.
Return false if the rank size will be given by the getSize method.
getPromptSize method,
false if the rank size will be given by the getSize method.org.apache.xmlbeans.XmlBoolean xgetPromptSizeActive()
Internal Use Only.
void setPromptSizeActive(boolean promptSizeActive)
getPromptSize method.
When called with false, it will cause the rank size to be given by the getSize method.
promptSizeActive - set to true if the rank size will be given by the getPromptSize method, otherwise falsevoid xsetPromptSizeActive(org.apache.xmlbeans.XmlBoolean promptSizeActive)
Internal Use Only.
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".
org.apache.xmlbeans.XmlInt xgetSize()
Internal Use Only.
boolean isSetSize()
true if the Size element is set, otherwise falsevoid 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".
size - the number of records that are returnedvoid xsetSize(org.apache.xmlbeans.XmlInt size)
Internal Use Only.
void unsetSize()
Podium.Enum getPodium()
Gets the Podium instance which specifies whether to return the "Top" n ranked results, or the "Bottom" n.
Rank instancePodium xgetPodium()
Internal Use Only.
void setPodium(Podium.Enum podium)
podium - the Podium instance for this Rank instancevoid xsetPodium(Podium podium)
Internal Use Only.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||