Class Variable

java.lang.Object
com.mckoi.database.Variable
All Implemented Interfaces:
Serializable, Cloneable

public final class Variable extends Object implements Serializable, Cloneable
This represents a column name that may be qualified. This object encapsulated a column name that can be fully qualified in the system. Such uses of this object would not typically be used against any context. For example, it would not be desirable to use ColumnName in DataTableDef because the column names contained in DataTableDef are within a known context. This object is intended for use within parser processes where free standing column names with potentially no context are required.

NOTE: This object is NOT immutable.

Author:
Tobias Downer
See Also:
  • Constructor Details

    • Variable

      public Variable(TableName table_name, String column_name)
      Constructs the ColumnName.
    • Variable

      public Variable(String column_name)
    • Variable

      public Variable(Variable v)
  • Method Details

    • getTableName

      public TableName getTableName()
      Returns the TableName context.
    • getName

      public String getName()
      Returns the column name context.
    • resolve

      public static Variable resolve(String name)
      Attempts to resolve a string '[table_name].[column]' to a Variable instance.
    • resolve

      public static Variable resolve(TableName tname, String name)
      Attempts to resolve a string '[table_name].[column]' to a Variable instance. If the table name does not exist, or the table name schema is not specified, then the schema/table name is copied from the given object.
    • resolveTableName

      public Variable resolveTableName(TableName tablen)
      Returns a ColumnName that is resolved against a table name context only if the ColumnName is unknown in this object.
    • set

      public Variable set(Variable from)
      Sets this Variable object with information from the given Variable.
    • setColumnName

      public void setColumnName(String column_name)
      Sets the column name of this variable. This should be used if the variable is resolved from one form to another.
    • setTableName

      public void setTableName(TableName tname)
      Sets the TableName of this variable.
    • clone

      public Object clone() throws CloneNotSupportedException
      Performs a deep clone of this object.
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
    • toTechString

      public String toTechString()
      To a differently formatted string.
    • equals

      public boolean equals(Object ob)
      Equality.
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Object ob)
      Comparable.
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object