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

E12063-08

oracle.dss.rules.discriminator
Class StringValueDiscriminator

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

public class StringValueDiscriminator
extends ValueDiscriminator

Discriminator for a rule that applies based on a comparison of one string and a vector of strings. For example, you could use this Discriminator to specify that a DiscriminatorRule should apply to string a in vector [a, b, c, d] This Discriminator compares an internal string 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_stringValue
           
static java.lang.String NAME_STR_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
StringValueDiscriminator()
          Constructor that does not specify a string or a relational operator.
StringValueDiscriminator(java.lang.String str, int operator)
          Constructor that specifies the string and the relational operator.
StringValueDiscriminator(java.util.Vector strings, int operator)
          Constructor that specifies the strings and the 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 StringValueDiscriminator.
 boolean equals(java.lang.Object o)
          Indicates whether the specified object is equivalent to this StringValueDiscriminator.
 java.lang.String getString()
          Retrieves the string for this StringValueDiscriminator.
 java.util.Vector getStrings()
          Retrieves the strings for this StringValueDiscriminator.
 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 setString(java.lang.String str)
          Specifies the string value for this StringValueDiscriminator.
 void setStrings(java.util.Vector strings)
          Specifies the strings for this StringValueDiscriminator.
 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

NAME_STR_VAL_DISC

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

a_stringValue

protected static final java.lang.String a_stringValue
See Also:
Constant Field Values
Constructor Detail

StringValueDiscriminator

public StringValueDiscriminator()
Constructor that does not specify a string or a relational operator. If you use this constructor, call the setStrings or the setString method to specify a number to compare with. Call setRelOperator to specify the way the numbers should compare, remembering that the left operand comes from the RuleContext and the right operand is the number that you set for this Discriminator.


StringValueDiscriminator

public StringValueDiscriminator(java.util.Vector strings,
                                int operator)
Constructor that specifies the strings and the relational operator.

Parameters:
strings - The vector of strings for this Discriminator. This vector becomes the right operand in the comparison.
operator - The relationship that the value from the RuleContext should have with strings, 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

StringValueDiscriminator

public StringValueDiscriminator(java.lang.String str,
                                int operator)
Constructor that specifies the string and the relational operator.

Parameters:
str - The string for this Discriminator. This number becomes the right operand in the comparison.
operator - The relationship that the value from the RuleContext should have with number, 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 StringValueDiscriminator.

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

setString

public void setString(java.lang.String str)
Specifies the string value for this StringValueDiscriminator.

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

setStrings

public void setStrings(java.util.Vector strings)
Specifies the strings for this StringValueDiscriminator.

Parameters:
strings - The strings that the string from the DataView item must compare to in order to apply. The relationship that the string vector and the string must have is specified by the RelOperator property of the superclass.

getStrings

public java.util.Vector getStrings()
Retrieves the strings for this StringValueDiscriminator.

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

getString

public java.lang.String getString()
Retrieves the string for this StringValueDiscriminator.

Returns:
The string to which the value from the DataView item will be compared. The relationship that the two strings 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 string for this StringValueDiscriminator is "HELLO" and the RelOperator is EQ (=), then this method returns true if the value in the specified RuleContext is "HELLO".

Parameters:
context - The context of the item to be displayed.
Returns:
true if the String value from context has the specified relationship with the strings in this Discriminator, false if not.

equals

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

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

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.

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.

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 Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.7.0)

E12063-08

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