Package com.mckoi.database
Class Variable
- java.lang.Object
-
- com.mckoi.database.Variable
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public final class Variable extends java.lang.Object implements java.io.Serializable, java.lang.CloneableThis 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:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Performs a deep clone of this object.intcompareTo(java.lang.Object ob)Comparable.booleanequals(java.lang.Object ob)Equality.java.lang.StringgetName()Returns the column name context.TableNamegetTableName()Returns the TableName context.inthashCode()Hash code.static Variableresolve(TableName tname, java.lang.String name)Attempts to resolve a string '[table_name].[column]' to a Variable instance.static Variableresolve(java.lang.String name)Attempts to resolve a string '[table_name].[column]' to a Variable instance.VariableresolveTableName(TableName tablen)Returns a ColumnName that is resolved against a table name context only if the ColumnName is unknown in this object.Variableset(Variable from)Sets this Variable object with information from the given Variable.voidsetColumnName(java.lang.String column_name)Sets the column name of this variable.voidsetTableName(TableName tname)Sets the TableName of this variable.java.lang.StringtoString()To string.java.lang.StringtoTechString()To a differently formatted string.
-
-
-
Method Detail
-
getTableName
public TableName getTableName()
Returns the TableName context.
-
getName
public java.lang.String getName()
Returns the column name context.
-
resolve
public static Variable resolve(java.lang.String name)
Attempts to resolve a string '[table_name].[column]' to a Variable instance.
-
resolve
public static Variable resolve(TableName tname, java.lang.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(java.lang.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 java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionPerforms a deep clone of this object.- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
To string.- Overrides:
toStringin classjava.lang.Object
-
toTechString
public java.lang.String toTechString()
To a differently formatted string.
-
equals
public boolean equals(java.lang.Object ob)
Equality.- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object ob)
Comparable.
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCodein classjava.lang.Object
-
-