org.eclipse.datatools.sqltools.sql.reference.internal
Class Datatype

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sql.reference.DBObject
      extended by org.eclipse.datatools.sqltools.sql.reference.internal.Datatype
All Implemented Interfaces:
IDatatype

public class Datatype
extends DBObject
implements IDatatype

Author:
dyang

Field Summary
 
Fields inherited from class org.eclipse.datatools.sqltools.sql.reference.DBObject
COLUMN, DATABASE, DATATYPE, EVENT, FUNCTION, GLOBAL_TEMPORARY_TABLE, LOCAL_TEMPORARY_TABLE, STORED_PROCEDURE, SYSTABLE, SYSTEM_FUNCTION, SYSTEM_STORED_PROCEDURE, SYSVIEW, TABLE, TABLE_ALIAS, TRIGGER, VIEW
 
Constructor Summary
Datatype(java.lang.String owner, java.lang.String name, boolean isUDT, IDatatype baseType)
           
Datatype(java.lang.String owner, java.lang.String name, boolean isUDT, IDatatype baseType, int length, int precision, int scale, boolean allownull)
           
 
Method Summary
 boolean allowNull()
          To test if this data type can have null value
 IDatatype getBaseType()
          Gets the base type of this data type,if this type is UDT,then return it's base type otherwise(it is system type),return itself
 java.lang.Object getDefaultValue()
          Gets the default value of this data type
 int getLength()
          Gets the physical lenght of this type
 int getPrecision()
          Gets the precision of this type, if precision is -1, then no precision defined
 int getScale()
          Gets the scale of this type, if precision is -1, then no scale defined
 boolean isUDT()
          To test if this data type is user-defined datatype or not
 void setAllowNull(boolean allowNull)
           
 void setBaseType(IDatatype baseType)
           
 void setDefaultValue(java.lang.Object defaultValue)
           
 void setLength(int length)
           
 void setPrecision(int precision)
           
 void setScale(int scale)
           
 void setUDT(boolean isUDT)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.datatools.sqltools.sql.reference.DBObject
getName, getOwner, getType, setName, setOwner, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Datatype

public Datatype(java.lang.String owner,
                java.lang.String name,
                boolean isUDT,
                IDatatype baseType)
Parameters:
owner -
name -
isUDT -
baseType -

Datatype

public Datatype(java.lang.String owner,
                java.lang.String name,
                boolean isUDT,
                IDatatype baseType,
                int length,
                int precision,
                int scale,
                boolean allownull)
Parameters:
owner -
name -
isUDT -
baseType -
length -
precision -
scale -
allownull -
Method Detail

isUDT

public boolean isUDT()
Description copied from interface: IDatatype
To test if this data type is user-defined datatype or not

Specified by:
isUDT in interface IDatatype

getBaseType

public IDatatype getBaseType()
Description copied from interface: IDatatype
Gets the base type of this data type,if this type is UDT,then return it's base type otherwise(it is system type),return itself

Specified by:
getBaseType in interface IDatatype

getDefaultValue

public java.lang.Object getDefaultValue()
Description copied from interface: IDatatype
Gets the default value of this data type

Specified by:
getDefaultValue in interface IDatatype

getLength

public int getLength()
Description copied from interface: IDatatype
Gets the physical lenght of this type

Specified by:
getLength in interface IDatatype

allowNull

public boolean allowNull()
Description copied from interface: IDatatype
To test if this data type can have null value

Specified by:
allowNull in interface IDatatype

setAllowNull

public void setAllowNull(boolean allowNull)
Specified by:
setAllowNull in interface IDatatype

setBaseType

public void setBaseType(IDatatype baseType)
Specified by:
setBaseType in interface IDatatype

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Specified by:
setDefaultValue in interface IDatatype

setLength

public void setLength(int length)
Specified by:
setLength in interface IDatatype

setUDT

public void setUDT(boolean isUDT)
Specified by:
setUDT in interface IDatatype

getPrecision

public int getPrecision()
Description copied from interface: IDatatype
Gets the precision of this type, if precision is -1, then no precision defined

Specified by:
getPrecision in interface IDatatype

getScale

public int getScale()
Description copied from interface: IDatatype
Gets the scale of this type, if precision is -1, then no scale defined

Specified by:
getScale in interface IDatatype

setPrecision

public void setPrecision(int precision)
Specified by:
setPrecision in interface IDatatype

setScale

public void setScale(int scale)
Specified by:
setScale in interface IDatatype

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object