Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.rules.discriminator
Class CompositeDiscriminator

java.lang.Object
  |
  +--oracle.dss.rules.discriminator.CompositeDiscriminator
All Implemented Interfaces:
java.lang.Cloneable, Discriminator, DiscriminatorXML, java.io.Serializable

public class CompositeDiscriminator
extends java.lang.Object
implements DiscriminatorXML

Discriminator that combines two Discriminator objects, for complex rules that are based on more than one kind of information. For example, you might want to italicize values for December 1999 that are greater than 500,000. To do this, you would create a QDRDiscriminator to specify the "December 1999" condition, and a NumberValueDiscriminator to specify the "greater than 500,000" condition. Then you would create a CompositeDiscriminator to combine the two conditions.

This class supports the following conditional operators: AND, OR, and NOT. Note that the NOT operation uses only the left operand.

See Also:
QDRDiscriminator, NumberValueDiscriminator, DiscriminatorRule, Serialized Form

Field Summary
static int AND
          Conditional AND (&&).
static int NOT
          Logical NOT (!).
static int OR
          Conditional OR (||).

 

Constructor Summary
CompositeDiscriminator()
          Constructor that does not specify base discriminators or an operator.
CompositeDiscriminator(Discriminator l, Discriminator r, int condOp)
          Constructor that specifies the base discriminators and the operator.

 

Method Summary
 boolean applies(RuleContext context)
          Specifies whether the composite condition is met by the specified RuleContext.
 java.lang.Object clone()
          Clones this CompositeDiscriminator.
 boolean equals(java.lang.Object o)
           
 int getCondOperator()
          Retrieves the conditional operator of this CompositeDiscriminator.
 Discriminator getLeft()
          Retrieves the left Descriminator.
 Discriminator getRight()
          Retrieves the right Descriminator.
 interface getXML(boolean allProperties, ComponentTypeConverter converter, boolean emptyElement)
          Retrieves XML that represents properties and their values in the form of and ObjectNode.
 void setCondOperator(int condOp)
          Specifies the conditional operator for this CompositeDiscriminator.
 void setLeft(Discriminator discriminator)
          Specifies the left Discriminator.
 void setRight(Discriminator discriminator)
          Specifies the right Discriminator.
 boolean setXML( node, ComponentTypeConverter converter, java.lang.String version, int reset)
          Specifies XML that represents properties and values.

 

Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

AND

public static final int AND
Conditional AND (&&). This CompositeDiscriminator will apply only when both base Discriminators apply.

OR

public static final int OR
Conditional OR (||). This CompositeDiscriminator will apply when either of the base Discriminators apply.

NOT

public static final int NOT
Logical NOT (!). This CompositeDiscriminator will apply when the base Discriminator (the left operand) does not apply. When you use this operator, you only need one Discriminator.
Constructor Detail

CompositeDiscriminator

public CompositeDiscriminator()
Constructor that does not specify base discriminators or an operator. If you use this constructor, call the setLeft and setRight methods to set the base discriminators. Call the setCondOperator to specify the conditional operator.

CompositeDiscriminator

public CompositeDiscriminator(Discriminator l,
Discriminator r,
                              int condOp)
Constructor that specifies the base discriminators and the operator.
Parameters:
l - The left Discriminator.
r - The right Discriminator.
int - A constant that specifies the conditional operator to use for this composite.
Method Detail

clone

public java.lang.Object clone()
Clones this CompositeDiscriminator.
Specified by:
clone in interface Discriminator
Returns:
The clone of this CompositeDiscriminator.

getCondOperator

public int getCondOperator()
Retrieves the conditional operator of this CompositeDiscriminator.
Returns:
A constant that represents the conditional operator that this CompositeDiscriminator uses to compare the two base discriminators.
See Also:
AND, OR, NOT

setCondOperator

public void setCondOperator(int condOp)
Specifies the conditional operator for this CompositeDiscriminator.
Parameters:
condOp - A constant that represents the conditional operator that CompositeDiscriminator uses to compare the two base discriminators. Valid constants are listed in the See Also section.
See Also:
AND, OR, NOT

getLeft

public Discriminator getLeft()
Retrieves the left Descriminator.
Returns:
The Discriminator that is the left operand in the composite condition.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

setLeft

public void setLeft(Discriminator discriminator)
Specifies the left Discriminator.
Parameters:
The - Discriminator to use as the left operand in the composite condition.

getRight

public Discriminator getRight()
Retrieves the right Descriminator.
Returns:
The Discriminator that is the right operand in the composite condition.

setRight

public void setRight(Discriminator discriminator)
Specifies the right Discriminator.
Parameters:
The - Discriminator to use as the right operand in the composite condition.

applies

public boolean applies(RuleContext context)
Specifies whether the composite condition is met by the specified RuleContext. This method passes the RuleContext to the applies method of each base Discriminator and evaluates the resulting conditional expression.
Specified by:
applies in interface Discriminator
Parameters:
context - The context of the item to be painted.
Returns:
true if the RuleContext meets the complex condition in this CompositeDiscriminator, false if not.

setXML

public boolean setXML( node,
ComponentTypeConverter converter,
                      java.lang.String version,
                      int reset)
Specifies XML that represents properties and values. This method applies the values of the properties in the XML to the Discriminator.
Specified by:
setXML in interface DiscriminatorXML
Parameters:
node - ObjectNode that has the properties and their values.
converter - A converter that converts component strings to integers and integers to strings.
version - The XML version.
reset - A constant that indicates how much to reset when XML is applied. Valid values are listed in the See Also section.
Returns:
true if XML is properly applied, false if the XML cannot be applied.
See Also:
Rule.RESET_NONE, Rule.RESET_XML_PROPERTIES, Rule.RESET_EVERYTHING

getXML

public getXML(boolean allProperties,
ComponentTypeConverter converter,
              boolean emptyElement)
Retrieves XML that represents properties and their values in the form of and ObjectNode.
Specified by:
getXML in interface DiscriminatorXML
Parameters:
allProperties - true to store all property values in XML, false to store only values that are different from default values.
converter - A converter that converts component strings to integers and integers to strings.
emptyElement - true if an empty element needs to be returned when none of the property values have changed from default. false if null should should be returned when none of the property values have changed from default. This argument is considered only if allProperties is false.
Returns:
XML for the properties and values.

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.