Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.6.0)

E12063-07

oracle.dss.rules.discriminator
Class CompositeDiscriminator

java.lang.Object
  extended by oracle.dss.rules.discriminator.CompositeDiscriminator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Discriminator, DiscriminatorState, DiscriminatorXML

public class CompositeDiscriminator
extends java.lang.Object
implements DiscriminatorXML, DiscriminatorState

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
protected static java.lang.String a_condOperator
           
protected static java.lang.String a_leftDisc
           
protected static java.lang.String a_rightDisc
           
protected static java.lang.String and
           
static int AND
          Conditional AND (&&).
protected  int m_condOperator
           
protected  java.util.Hashtable m_context
           
protected  Discriminator m_left
           
protected  Discriminator m_right
           
static java.lang.String NAME_COMPOS_DISC
           
protected static java.lang.String not
           
static int NOT
          Logical NOT (!).
protected static java.lang.String or
           
static int OR
          Conditional OR (||).
protected static java.lang.String s_condOperator
           
protected static java.lang.String S_NAME_COMPOS_DISC
           
protected static java.lang.String s_rightDisc
           
 
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.
static Discriminator createDiscriminator(java.util.List context, oracle.dss.util.xml.ObjectNode discNode, DiscriminatorState baseState)
           
 boolean equals(java.lang.Object o)
          Determine if the given object is equal to this CompositeDiscriminator.
 int getCondOperator()
          Retrieves the conditional operator of this CompositeDiscriminator.
 Discriminator getLeft()
          Retrieves the left Descriminator.
 Discriminator getRight()
          Retrieves the right Descriminator.
 oracle.dss.util.xml.ObjectNode getStateAsObjectNode(java.util.List memberContext, DiscriminatorState baseState)
           
 oracle.dss.util.xml.ObjectNode 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 setContext(java.util.Hashtable context)
           
 void setLeft(Discriminator discriminator)
          Specifies the left Discriminator.
 void setRight(Discriminator discriminator)
          Specifies the right Discriminator.
 void setStateAsObjectNode(java.util.List context, oracle.dss.util.xml.ObjectNode node, DiscriminatorState baseState)
           
 boolean setXML(oracle.dss.util.xml.ObjectNode node, ComponentTypeConverter converter, java.lang.String version, int reset)
          Specifies XML that represents properties and values.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_left

protected Discriminator m_left

m_right

protected Discriminator m_right

m_condOperator

protected int m_condOperator

AND

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

See Also:
Constant Field Values

OR

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

S_NAME_COMPOS_DISC

protected static final java.lang.String S_NAME_COMPOS_DISC
See Also:
Constant Field Values

s_condOperator

protected static final java.lang.String s_condOperator
See Also:
Constant Field Values

s_rightDisc

protected static final java.lang.String s_rightDisc
See Also:
Constant Field Values

m_context

protected java.util.Hashtable m_context

NAME_COMPOS_DISC

public static final java.lang.String NAME_COMPOS_DISC
See Also:
Constant Field Values

a_condOperator

protected static final java.lang.String a_condOperator
See Also:
Constant Field Values

a_rightDisc

protected static final java.lang.String a_rightDisc
See Also:
Constant Field Values

a_leftDisc

protected static final java.lang.String a_leftDisc
See Also:
Constant Field Values

and

protected static final java.lang.String and
See Also:
Constant Field Values

or

protected static final java.lang.String or
See Also:
Constant Field Values

not

protected static final java.lang.String not
See Also:
Constant Field Values
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
Overrides:
clone in class java.lang.Object
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)
Determine if the given object is equal to this CompositeDiscriminator.

Overrides:
equals in class java.lang.Object
Parameters:
o - object to test for equality
Returns:
true if the objects are equal, false if not

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.

setContext

public void setContext(java.util.Hashtable context)
Parameters:
context - A hashtable that a user can use to pass XMLContext One can also use this table to pass more information to its objects.

setXML

public boolean setXML(oracle.dss.util.xml.ObjectNode 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 oracle.dss.util.xml.ObjectNode 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.

setStateAsObjectNode

public void setStateAsObjectNode(java.util.List context,
                                 oracle.dss.util.xml.ObjectNode node,
                                 DiscriminatorState baseState)
Specified by:
setStateAsObjectNode in interface DiscriminatorState

getStateAsObjectNode

public oracle.dss.util.xml.ObjectNode getStateAsObjectNode(java.util.List memberContext,
                                                           DiscriminatorState baseState)
Specified by:
getStateAsObjectNode in interface DiscriminatorState

createDiscriminator

public static Discriminator createDiscriminator(java.util.List context,
                                                oracle.dss.util.xml.ObjectNode discNode,
                                                DiscriminatorState baseState)

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.6.0)

E12063-07

Copyright © 1997, 2011, Oracle. All rights reserved.