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

E12063-04

oracle.dss.rules.discriminator
Class DateValueDiscriminator

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

public class DateValueDiscriminator
extends ValueDiscriminator
implements DiscriminatorState

Discriminator for a rule that applies based on a comparison of two date values. For example, you could use this Discriminator to specify that a DiscriminatorRule should apply to date values after 11/20/98. This Discriminator compares an internal Date value to a value that is in the RuleContext that describes the item to be displayed. In the comparison, the left operand comes from the RuleContext, and the right operand is the value stored in this Discriminator.

See Also:
Serialized Form

Field Summary
protected static java.lang.String a_date
           
static java.lang.String NAME_DATE_VAL_DISC
           
protected static java.lang.String s_date
           
protected static java.lang.String S_NAME_DATE_VAL_DISC
           
 
Fields inherited from class oracle.dss.rules.discriminator.ValueDiscriminator
a_relOperator, eq, EQ, ge, GE, gt, GT, le, LE, lt, LT, m_relOperator, ne, NE, s_relOperator
 
Constructor Summary
DateValueDiscriminator()
          Constructor that does not specify a date or a relational operator.
DateValueDiscriminator(java.sql.Date date, int relationalOperator)
          Constructor that specifies the date and relational operator.
 
Method Summary
 boolean applies(RuleContext context)
          Specifies whether the value from the DataView item meets the conditions specified in this Discriminator.
 java.lang.Object clone()
          Clones this DateValueDiscriminator.
 boolean equals(java.lang.Object o)
          Indicates whether the specified object is equivalent to this DateValueDiscriminator.
 java.sql.Date getDate()
          Retrieves the date for this DateValueDiscriminator.
 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 setDate(java.sql.Date date)
          Specifies the date value for this DateValueDiscriminator.
 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 oracle.dss.rules.discriminator.ValueDiscriminator
convertRelOperatorToInt, convertRelOperatorToString, getRelOperator, setRelOperator
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S_NAME_DATE_VAL_DISC

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

s_date

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

a_date

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

NAME_DATE_VAL_DISC

public static final java.lang.String NAME_DATE_VAL_DISC
See Also:
Constant Field Values
Constructor Detail

DateValueDiscriminator

public DateValueDiscriminator()
Constructor that does not specify a date or a relational operator. If you use this constructor, then call the setDate method to specify a date to compare with. Call setRelOperator to specify the way the dates should compare, remembering that the left operand comes from the RuleContext and the right operand is the date that you set for this Discriminator.


DateValueDiscriminator

public DateValueDiscriminator(java.sql.Date date,
                              int relationalOperator)
Constructor that specifies the date and relational operator.

Parameters:
date - The value for this Discriminator. This date becomes the right operand in the comparison.
relationalOperator - The relationship that the value from the RuleContext should have with date, in order for this Discriminator to apply. Valid constants are listed in the See Also section.
See Also:
ValueDiscriminator.EQ, ValueDiscriminator.GE, ValueDiscriminator.GT, ValueDiscriminator.LE, ValueDiscriminator.LT, ValueDiscriminator.NE
Method Detail

clone

public java.lang.Object clone()
Clones this DateValueDiscriminator.

Specified by:
clone in interface Discriminator
Specified by:
clone in class ValueDiscriminator
Returns:
The clone of this DateValueDiscriminator.

setDate

public void setDate(java.sql.Date date)
Specifies the date value for this DateValueDiscriminator.

Parameters:
d - The date that the date from the DataView item must compare to in order to apply. The relationship that the two dates must have is specified by the RelOperator property of the superclass.

getDate

public java.sql.Date getDate()
Retrieves the date for this DateValueDiscriminator.

Returns:
The date to which the value from the DataView item will be compared. The relationship that the two dates must have is specified by the RelOperator property of the superclass.

applies

public boolean applies(RuleContext context)
Specifies whether the value from the DataView item meets the conditions specified in this Discriminator. For example, if the date for this DateValueDiscriminator is 11/20/98 and the RelOperator is GT (>), then this method returns true if the value in the specified RuleContext is after 11/20/98.

Specified by:
applies in interface Discriminator
Parameters:
context - The context of the item to be displayed.
Returns:
true if the Date value from context has the specified relationship with the number in this Discriminator, false if not.

equals

public boolean equals(java.lang.Object o)
Indicates whether the specified object is equivalent to this DateValueDiscriminator. They are equivalent if the dates are equal and if the RelOperator values are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare with this DateValueDiscriminator.
Returns:
true if both objects have the same date and RelOperator false if not or if o is not a DateValueDiscriminator.

setXML

public boolean setXML(oracle.dss.util.xml.ObjectNode node,
                      ComponentTypeConverter converter,
                      java.lang.String version,
                      int reset)
Description copied from interface: DiscriminatorXML
Specifies XML that represents properties and values. This method applies the values of the properties in the XML to the DiscriminatorXML.

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 vice versa.
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)
Description copied from interface: DiscriminatorXML
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

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

E12063-04

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