Class SelectValue

  • All Implemented Interfaces:
    SQLStringable

    public class SelectValue
    extends java.lang.Object
    implements SQLStringable
    Represents an AbstractValue with an alias, suitable for use in the SELECT portion of an SQL query.
    Author:
    Matthew Wakeling
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String alias  
      protected AbstractValue v  
    • Constructor Summary

      Constructors 
      Constructor Description
      SelectValue​(AbstractValue v, java.lang.String alias)
      Construct a new SelectValue.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Overrides Object.equals().
      java.lang.String getAlias()
      Gets the alias from this object.
      java.lang.String getSQLString()
      Returns a String representation of this Field object, suitable for forming part of an SQL SELECT list.
      AbstractValue getValue()
      Gets the AbstractValue from this object.
      int hashCode()
      Overrides Object.hashCode().
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • alias

        protected java.lang.String alias
    • Constructor Detail

      • SelectValue

        public SelectValue​(AbstractValue v,
                           java.lang.String alias)
        Construct a new SelectValue.
        Parameters:
        v - the AbstractValue that this SelectValue holds
        alias - the alias that the value is renamed to
    • Method Detail

      • getSQLString

        public java.lang.String getSQLString()
        Returns a String representation of this Field object, suitable for forming part of an SQL SELECT list.
        Specified by:
        getSQLString in interface SQLStringable
        Returns:
        the String representation
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides Object.equals().
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - an Object to compare to
        Returns:
        true if the object is equal
      • hashCode

        public int hashCode()
        Overrides Object.hashCode().
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an arbitrary integer based on the contents of the SelectField
      • getValue

        public AbstractValue getValue()
        Gets the AbstractValue from this object.
        Returns:
        the AbstractValue of this object
      • getAlias

        public java.lang.String getAlias()
        Gets the alias from this object.
        Returns:
        the alias of this object