Class NameValue

  • Direct Known Subclasses:
    Bindings, NameOpValue

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

      • attribute

        protected String attribute
      • values

        protected List values
    • Constructor Detail

      • NameValue

        public NameValue​(String attribute)
    • Method Detail

      • setAttribute

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

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

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

        public 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​(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 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​(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 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)