com.businessobjects.rebean.wi
Interface FilterCondition

All Superinterfaces:
FilterConditionOperand

public interface FilterCondition
extends FilterConditionOperand

Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.

The FilterCondition interface defines a value to test an object with in a filter or a condition.

Depending on which operator has been set, zero, one or more values have to be specified in this object.


Method Summary
 ConditionObjectValue createConditionObjectValue(DataSourceObject ds)
          This function is used to create a FilterCondition based on an existing DataSourceObject.
 ConditionPrompt createConditionPrompt(java.lang.String question)
          Creates a prompt and adds it to the operand list.
 FilterConditionConstant createFilterConditionConstant(java.lang.String value)
          Creates a constant value and adds it to the operand list.
 ConditionCorrelationValue createFilterConditionQuery(DataProvider dp, java.lang.String objID, int correlation)
          This function is used to create a FilterCondition based on a DataProvider object.
 FilterConditionConstant createFilterConditionValueFromLOV(ValueFromLov value)
          Creates a FilterConditionConstant object from a ValueFromLov object and adds it to the operand list.
 int getMaxOperandCount()
          Gets the maximum amount of operands for the current operator, if the number of operands is bound to a maximum.
 int getMinOperandCount()
          Gets the minimum amount of operands for the current operator.
 FilterConditionValue getOperand(int index)
          Returns the operand at the specified position in the list.
 int getOperandCount()
          Returns the number of operands currently added for this filter condition.
 Operator getOperator()
          Returns the operator.
 void removeAllOperands()
          Removes any operands.
 void removeOperand(FilterConditionValue operand)
          Removes an operand.
 void setOperator(Operator operator)
          Changes the operator.
 

Method Detail

createFilterConditionConstant

FilterConditionConstant createFilterConditionConstant(java.lang.String value)
Creates a constant value and adds it to the operand list.

Parameters:
value - the new filter constant's value
Returns:
A FilterConditionConstant instance.
Throws:
FilterConditionException - when the new operand would introduce too many operands for the current operator (ie before this method call was made, getOperandCount() == getMaxOperandCount() evaluated to true)
java.lang.NullPointerException - when value is null
See Also:
FilterCondition.getMaxOperandCount()

createConditionPrompt

ConditionPrompt createConditionPrompt(java.lang.String question)
Creates a prompt and adds it to the operand list.

Parameters:
question - The new filter constant's value
Returns:
A ConditionPrompt instance.
Throws:
FilterConditionException - when the new operand would introduce too many operands for the current operator (ie before this method call was made, getOperandCount() == getMaxOperandCount() evaluated to true)
FilterConditionException - when this FilterCondition is part of a FilterObject (no prompts are allowed on filters)
java.lang.NullPointerException - when question is null
See Also:
FilterCondition.getMaxOperandCount()

getOperator

Operator getOperator()
Returns the operator.

Returns:
the operator

setOperator

void setOperator(Operator operator)

Changes the operator. If there are too many operands for the new operator, any oparends with index >= getMaxOperandCount() for the new operator, will be removed.

Note that some operators are not allowed on certain object types, see Operator for more details.

Parameters:
operator - the new operator
Throws:
FilterConditionException - when operator is illegal for the object defined in FilterConditionObject, or when operator can only be applied on conditions and this FilterCondition is part of a FilterObject.
java.lang.NullPointerException - when operator is null
java.lang.UnsupportedOperationException - when operator isn't supported by DataSource.

getOperandCount

int getOperandCount()
Returns the number of operands currently added for this filter condition.

Returns:
the number of operands

getMinOperandCount

int getMinOperandCount()
Gets the minimum amount of operands for the current operator.

Returns:
the minimum amount of operands for the current operator

getMaxOperandCount

int getMaxOperandCount()
Gets the maximum amount of operands for the current operator, if the number of operands is bound to a maximum.

Returns:
the maximum amount of operands for the current operator, or -1 when there is no maximum

getOperand

FilterConditionValue getOperand(int index)
Returns the operand at the specified position in the list.

Parameters:
index - the index of the operand to return (0 based)
Returns:
A FilterConditionValue instance.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of range (index < 0 || index >= getOperandCount())

removeOperand

void removeOperand(FilterConditionValue operand)
Removes an operand.

Parameters:
operand - The operand to remove. When null or the operand is not in the operand list, nothing happens

removeAllOperands

void removeAllOperands()
Removes any operands.


createConditionObjectValue

ConditionObjectValue createConditionObjectValue(DataSourceObject ds)
This function is used to create a FilterCondition based on an existing DataSourceObject. An example of a condition in a query is: "Country" equal to "Country of Origin".

Parameters:
ds - a DataSourceObject
Returns:
a ConditionObjectValue object
Since:
11.5
See Also:
DataSource, DataSource.getClasses(), DataSource.getHierarchies(), DataProvider

createFilterConditionQuery

ConditionCorrelationValue createFilterConditionQuery(DataProvider dp,
                                                     java.lang.String objID,
                                                     int correlation)
This function is used to create a FilterCondition based on a DataProvider object. This function takes the DataProvider and the ID of the data provider object to create a FilterCondition object.

Parameters:
dp - the data provider from which a result object is selected to create the filter operand.
objID - the ID of the object.
correlation - the value of the correlation operator.
Returns:
a ConditionCorrelationValue object.
Since:
12.2.0
See Also:
DataProvider, Correlation

createFilterConditionValueFromLOV

FilterConditionConstant createFilterConditionValueFromLOV(ValueFromLov value)
Creates a FilterConditionConstant object from a ValueFromLov object and adds it to the operand list.

Parameters:
value - A ValueFromLov object.
Returns:
A FilterConditionConstant object.
Throws:
java.lang.NullPointerException - When value is null or value.getValue() returns null.
Since:
11.5