Package com.mckoi.database.interpret
Class ColumnDef
- java.lang.Object
-
- com.mckoi.database.interpret.ColumnDef
-
- All Implemented Interfaces:
StatementTreeObject,java.io.Serializable,java.lang.Cloneable
public final class ColumnDef extends java.lang.Object implements java.io.Serializable, StatementTreeObject, java.lang.Cloneable
Represents a column definition (description).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Expressiondefault_expression(package private) java.lang.Stringindex_str(package private) java.lang.Stringnameprivate booleannot_null(package private) Expressionoriginal_default_expressionprivate booleanprimary_key(package private) static longserialVersionUID(package private) TTypetypeprivate booleanunique
-
Constructor Summary
Constructors Constructor Description ColumnDef()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConstraint(java.lang.String constraint)Adds a constraint to this column.java.lang.Objectclone()Performs a DEEP clone of this object if it is mutable, or a deep clone of its mutable members.booleanisNotNull()Returns true if this column has the not null constraint set for it.booleanisPrimaryKey()Returns true if this column has a primary key constraint set on it.booleanisUnique()Returns true if this column has the unique constraint set for it.voidprepareExpressions(ExpressionPreparer preparer)Prepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.voidsetDataType(TType type)Sets the type of data of this column.voidsetDefaultExpression(Expression exp)Sets the default expression (this is used to make a new constraint).voidsetIndex(Token t)Sets the indexing.voidsetName(java.lang.String name)Sets the name of the column.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
java.lang.String name
-
type
TType type
-
index_str
java.lang.String index_str
-
default_expression
Expression default_expression
-
original_default_expression
Expression original_default_expression
-
not_null
private boolean not_null
-
primary_key
private boolean primary_key
-
unique
private boolean unique
-
-
Method Detail
-
isPrimaryKey
public boolean isPrimaryKey()
Returns true if this column has a primary key constraint set on it.
-
isUnique
public boolean isUnique()
Returns true if this column has the unique constraint set for it.
-
isNotNull
public boolean isNotNull()
Returns true if this column has the not null constraint set for it.
-
setName
public void setName(java.lang.String name)
Sets the name of the column.
-
addConstraint
public void addConstraint(java.lang.String constraint)
Adds a constraint to this column.
-
setDataType
public void setDataType(TType type)
Sets the type of data of this column.
-
setIndex
public void setIndex(Token t) throws ParseException
Sets the indexing.- Throws:
ParseException
-
setDefaultExpression
public void setDefaultExpression(Expression exp)
Sets the default expression (this is used to make a new constraint).
-
prepareExpressions
public void prepareExpressions(ExpressionPreparer preparer) throws DatabaseException
Description copied from interface:StatementTreeObjectPrepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.- Specified by:
prepareExpressionsin interfaceStatementTreeObject- Throws:
DatabaseException
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionDescription copied from interface:StatementTreeObjectPerforms a DEEP clone of this object if it is mutable, or a deep clone of its mutable members. If the object is immutable then it may return 'this'.- Specified by:
clonein interfaceStatementTreeObject- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-