|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Filter
Provides the functionality to create a filter query condition. For example, you can use this interface to create a condition where the query results are limited based on criteria defined in the filter. The following example shows you how to create a filter query condition where only data for the "Country" equaling "France" are returned in the query results.
Example: Creating a filter query condition.
Note: This example assumes that you have created a QueryObject array called
boQueryResultObjects that contains query result object keys from the Universe.
QuerySpecification boQuerySpec = QuerySpecification.Factory.newInstance();
Query boQuery1 = Query.Factory.newInstance();
QueryCondition boQueryCondition = QueryCondition.Factory.newInstance();
Filter boCondFilter = Filter.Factory.newInstance();
QueryObject boQueryConditionObject = QueryObject.Factory.newInstance();
boQueryConditionObject.setKey((String)dimensionKeys.get(0));
boCondFilter.setFilteredObject(boQueryConditionObject);
boCondFilter.setFilterOperator(FilterOperator.EQUAL);
Operand[] boConditionValues = new Operand[1];
Values boFreeValues = Values.Factory.newInstance();
String[] boConditionValueString = new String[] {"France"};
boFreeValues.setFreeValueArray(boConditionValueString);
boConditionValues[0] = boFreeValues;
boCondFilter.setOperandArray(boConditionValues);
ConditionBase[] boConditionBase = new ConditionBase[1];
boConditionBase[0] = boCondFilter;
boQueryCondition.setItemArray(boConditionBase);
boQuery1.setQueryCondition(boQueryCondition);
boQuery1.setQueryResultArray(boQueryResultObjects);
boQuerySpec.setQueryBase(boQuery1);
Operand,
Values,
Prompt| Nested Class Summary | |
|---|---|
static class |
Filter.Factory
A class with methods for creating instances of the Filter type. |
| Field Summary | |
|---|---|
static org.apache.xmlbeans.SchemaType |
type
Internal Use Only. |
| Method Summary | |
|---|---|
QueryObject |
addNewFilteredObject()
Appends and returns a new empty "FilteredObject" element |
Operand |
addNewOperand()
Appends and returns a new empty value (as xml) as the last "Operand" element. |
QueryObject |
getFilteredObject()
Gets the result object that the filter is based on. |
FilterOperator.Enum |
getFilterOperator()
Gets the operator used between the object being filtered (for example, a field representing Country) and the operand (for example, an object that represents the String "France"). |
Operand[] |
getOperandArray()
Gets the values that are used as the operand in the filter condition. |
Operand |
getOperandArray(int i)
Gets a value used as a operand in the filter condition that is stored in the operand array position indexed by the parameter i. |
Operand |
insertNewOperand(int i)
Inserts and returns a new empty value (as xml) of the "Operand" element at the specified index position. |
void |
removeOperand(int i)
Removes the Operand element at the specified index position. |
void |
setFilteredObject(QueryObject filteredObject)
Sets the result object to base the filter on. |
void |
setFilterOperator(FilterOperator.Enum filterOperator)
Sets the operator used between the object being filtered (for example, a field representing Country) and the operand (for example, an object that represents the String "France"). |
void |
setOperandArray(int i,
Operand operand)
Sets a value used as an operand in the filter condition to the position in the operand array indicated by the index parameter i. |
void |
setOperandArray(Operand[] operandArray)
Sets the values to be used as the operand in the filter condition. |
int |
sizeOfOperandArray()
Returns number of "Operand" element |
FilterOperator |
xgetFilterOperator()
Internal Use Only. |
void |
xsetFilterOperator(FilterOperator filterOperator)
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 result object that the filter is based on. For more information see, setFilteredObject.
void setFilteredObject(QueryObject filteredObject)
Sets the result object to base the filter on. For example, if the Universe contains a
field called "Country", and you want to limit the results based on the Country field, you
would pass in a QueryObject instance whose Key is set to the Key of the query result
object that represents the Country field.
filteredObject - a QueryObject instance whose Key is set to the Key of the query result
object that represents the field you want to base the filter onQueryObject addNewFilteredObject()
Operand[] getOperandArray()
Gets the values that are used as the operand in the filter condition. For example,
given the filter condition, "Country = France", the operand is "France". This method returns
an array containing either Values, Prompt, or ObjectComparison instances.
Values, Prompt, or ObjectComparison instancesOperand getOperandArray(int i)
Gets a value used as a operand in the filter condition that is stored
in the operand array position indexed by the parameter i. Given
the filter condition, "Country = France", the operand is "France". This method returns
either a Values, Prompt, or ObjectComparison instance.
i - The position in the operand array from which the operand is retrieved
Values, Prompt, or ObjectComparison instancecom.businessobjects.query.Filter#getOperand()int sizeOfOperandArray()
void setOperandArray(Operand[] operandArray)
Sets the values to be used as the operand in the filter condition. For example,
given the filter condition, "Country = France", the operand is "France". You must pass in
an array containing either Values, Prompt, or ObjectComparison instances to this
method.
Note: To set the operand to a String (or a String array), you must
use a Values instance.
operandArray - an array containing Values, Prompt, or ObjectComparison instancesValues,
Prompt,
ObjectComparison
void setOperandArray(int i,
Operand operand)
Sets a value used as an operand in the filter condition to the position in the operand array
indicated by the index parameter i. You must pass in
either a Values, Prompt, or ObjectComparison to this
method.
Given the filter condition, "Country = France", the operand is "France".
Note: To set the operand to a String (or a String array), you must
use a Values instance.
i - The position in the operand array where the operand is to be storedoperand - a Values, Prompt, or ObjectComparison instanceOperand insertNewOperand(int i)
i - The index of the Operand element
Operand addNewOperand()
void removeOperand(int i)
i - The index of the Operand element.FilterOperator.Enum getFilterOperator()
Gets the operator used between the object being filtered (for example, a field representing
Country) and the operand (for example, an object that represents the String "France"). So,
if the condition filter is set to Country = "France", this method would return FilterOperator.Equal.
FilterOperatorFilterOperator xgetFilterOperator()
Internal Use Only.
void setFilterOperator(FilterOperator.Enum filterOperator)
Sets the operator used between the object being filtered (for example, a field representing
Country) and the operand (for example, an object that represents the String "France"). So,
if you want to return results where the Country = "France", you would set the filter operator
to FilterOperator.Equal.
filterOperator - the operator used between the object being filtered and the operandFilterOperatorvoid xsetFilterOperator(FilterOperator filterOperator)
Internal Use Only.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||