Class NameValue

  • Direct Known Subclasses:
    Bindings, NameOpValue

    public abstract class NameValue
    extends java.lang.Object
    This class represents an attribute that is associated with multiple values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String attribute  
      protected java.util.List values  
    • Constructor Summary

      Constructors 
      Constructor Description
      NameValue​(java.lang.String attribute)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Removes all values associated with the attribute.
      java.lang.String getAttribute()
      Returns the attribute name.
      java.lang.Object getFirstValue()
      Returns the first value (if any) in the list.
      java.util.List getValues()
      Returns the list of values.
      boolean merge​(NameValue nv)  
      boolean remove​(java.lang.Object value)
      Removes a specific value from the list of values.
      void setAttribute​(java.lang.String attrib)
      Sets the attribute name.
      void setValues​(java.util.List values)
      Sets the list of values.
      java.lang.String toRSL​(boolean explicitConcat)
      Returns a RSL representation of this relation.
      abstract void toRSL​(java.lang.StringBuffer buf, boolean explicitConcat)
      Produces a RSL representation of this relation.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • attribute

        protected java.lang.String attribute
      • values

        protected java.util.List values
    • Constructor Detail

      • NameValue

        public NameValue​(java.lang.String attribute)
    • Method Detail

      • setAttribute

        public void setAttribute​(java.lang.String attrib)
        Sets the attribute name.
        Parameters:
        attrib - the attribute name.
      • setValues

        public void setValues​(java.util.List values)
        Sets the list of values.
        Parameters:
        values - list of values.
      • getAttribute

        public java.lang.String getAttribute()
        Returns the attribute name.
        Returns:
        the attribute name.
      • getValues

        public java.util.List getValues()
        Returns the list of values.
        Returns:
        list of values.
      • clear

        public void clear()
        Removes all values associated with the attribute.
      • remove

        public boolean remove​(java.lang.Object value)
        Removes a specific value from the list of values. The value must be matched exactly to be removed from the list.
        Parameters:
        value - value to remove.
        Returns:
        true if the value was successfuly removed from the list of values. False, otherwise.
      • toRSL

        public java.lang.String toRSL​(boolean explicitConcat)
        Returns a RSL representation of this relation.
        Parameters:
        explicitConcat - if true explicit concatination will be used in RSL strings.
        Returns:
        RSL representation of this relation.
      • toRSL

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

        public java.lang.Object getFirstValue()
        Returns the first value (if any) in the list.
        Returns:
        the first value. Null, if there is no values at all.
      • merge

        public boolean merge​(NameValue nv)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object