oracle.dss.rules.discriminator
Class DateValueDiscriminator
java.lang.Object
|
+--oracle.dss.rules.discriminator.ValueDiscriminator
|
+--oracle.dss.rules.discriminator.DateValueDiscriminator
- All Implemented Interfaces:
- java.lang.Cloneable, Discriminator, DiscriminatorXML, java.io.Serializable
- public class DateValueDiscriminator
- extends ValueDiscriminator
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
| 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. |
void |
setDate(java.sql.Date date)
Specifies the date value for this DateValueDiscriminator. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
clone
public java.lang.Object clone()
- Clones this
DateValueDiscriminator.
-
- Overrides:
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.
-
- 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.
Copyright © 2003, Oracle. All Rights Reserved.