Class NameOpValue


  • public class NameOpValue
    extends NameValue
    This class represents a single relation in the RSL string.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int EQ  
      static int GT  
      static int GTEQ  
      static int LT  
      static int LTEQ  
      static int NEQ  
      protected int operator  
    • Constructor Summary

      Constructors 
      Constructor Description
      NameOpValue​(java.lang.String attribute)  
      NameOpValue​(java.lang.String attribute, int op)  
      NameOpValue​(java.lang.String attribute, int op, java.lang.String strValue)  
      NameOpValue​(java.lang.String attribute, int op, java.lang.String[] strValues)  
      NameOpValue​(java.lang.String attribute, int op, Value value)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String strValue)
      Adds a value to the list of values.
      void add​(java.lang.String[] strValues)
      Adds an array of values to the list of values.
      void add​(java.util.List list)
      Adds a list to the list of values.
      void add​(Value value)
      Adds a value to the list of values.
      NameOpValue evaluate​(java.util.Map symbolTable)
      Evaluates the relation against the symbol table.
      private java.util.List evaluateSub​(java.util.List values, java.util.Map symbolTable)  
      int getOperator()
      Returns the relation operator.
      java.lang.String getOperatorAsString()
      Returns the relation operator as a string.
      static java.lang.String getOperatorAsString​(int op)
      Returns a string representation of the specified relation operator.
      static java.util.List getValuesAsString​(java.util.List values, boolean includeNested)  
      java.util.List getValuesAsStrings​(boolean includeNested)  
      void setOperator​(int oper)
      Sets the relation operator.
      void toRSL​(java.lang.StringBuffer buf, boolean explicitConcat)
      Produces a RSL representation of this relation.
      private void toRSLSub​(java.util.List values, java.lang.StringBuffer buf, boolean explicitConcat)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NameOpValue

        public NameOpValue​(java.lang.String attribute)
      • NameOpValue

        public NameOpValue​(java.lang.String attribute,
                           int op)
      • NameOpValue

        public NameOpValue​(java.lang.String attribute,
                           int op,
                           java.lang.String strValue)
      • NameOpValue

        public NameOpValue​(java.lang.String attribute,
                           int op,
                           java.lang.String[] strValues)
      • NameOpValue

        public NameOpValue​(java.lang.String attribute,
                           int op,
                           Value value)
    • Method Detail

      • setOperator

        public void setOperator​(int oper)
        Sets the relation operator.
        Parameters:
        oper - the relation operator.
      • getOperator

        public int getOperator()
        Returns the relation operator.
        Returns:
        the relation operator.
      • getOperatorAsString

        public java.lang.String getOperatorAsString()
        Returns the relation operator as a string.
        Returns:
        the relation operator as a string.
      • getOperatorAsString

        public static java.lang.String getOperatorAsString​(int op)
        Returns a string representation of the specified relation operator.
        Parameters:
        op - the relation operator
        Returns:
        the string representaion of the relation operator.
      • add

        public void add​(Value value)
        Adds a value to the list of values.
        Parameters:
        value - the value to add.
      • add

        public void add​(java.lang.String strValue)
        Adds a value to the list of values. The string value is first converted into a Value object.
        Parameters:
        strValue - the value to add.
      • add

        public void add​(java.lang.String[] strValues)
        Adds an array of values to the list of values. Each element in the array is converted into a Value object and inserted as a separate value into the list of values.
        Parameters:
        strValues - the array of values to add.
      • add

        public void add​(java.util.List list)
        Adds a list to the list of values. It is inserted as a single element.
        Parameters:
        list - the list to add.
      • getValuesAsStrings

        public java.util.List getValuesAsStrings​(boolean includeNested)
      • getValuesAsString

        public static java.util.List getValuesAsString​(java.util.List values,
                                                       boolean includeNested)
      • toRSL

        public void toRSL​(java.lang.StringBuffer buf,
                          boolean explicitConcat)
        Produces a RSL representation of this relation.
        Specified by:
        toRSL in class NameValue
        Parameters:
        buf - buffer to add the RSL representation to.
        explicitConcat - if true explicit concatination will be used in RSL strings.
      • toRSLSub

        private void toRSLSub​(java.util.List values,
                              java.lang.StringBuffer buf,
                              boolean explicitConcat)
      • evaluate

        public NameOpValue evaluate​(java.util.Map symbolTable)
                             throws RslEvaluationException
        Evaluates the relation against the symbol table.
        Parameters:
        symbolTable - the symbol table to evalute the relation against.
        Returns:
        a new evaluted relation.
        Throws:
        RslEvaluationException - If an error occured during rsl evaluation.