org.xerial.db.datatype
Class DataTypeBase

java.lang.Object
  extended by org.xerial.db.datatype.DataTypeBase
All Implemented Interfaces:
Comparable<DataType>, DataType
Direct Known Subclasses:
BooleanType, DoubleType, IntegerType, LongType, PasswordType, StringListType, StringType, TextType

public abstract class DataTypeBase
extends Object
implements DataType

Author:
leo

Constructor Summary
DataTypeBase(String name)
           
DataTypeBase(String name, boolean isPrimaryKey)
           
DataTypeBase(String name, boolean isPrimaryKey, boolean isNotNull)
           
 
Method Summary
 int compareTo(DataType o)
           
 boolean equals(Object obj)
           
 String getName()
          Gets the parameter name (column name in a relation) of the type
 boolean isNotNull()
          allowed to be null?
 boolean isPrimaryKey()
          is primary key?
 void setNotNull(boolean isNotNull)
           
 void setPrimaryKey(boolean isPrimaryKey)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xerial.db.datatype.DataType
getTypeName
 

Constructor Detail

DataTypeBase

public DataTypeBase(String name)

DataTypeBase

public DataTypeBase(String name,
                    boolean isPrimaryKey)

DataTypeBase

public DataTypeBase(String name,
                    boolean isPrimaryKey,
                    boolean isNotNull)
Method Detail

compareTo

public int compareTo(DataType o)
Specified by:
compareTo in interface Comparable<DataType>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getName

public String getName()
Description copied from interface: DataType
Gets the parameter name (column name in a relation) of the type

Specified by:
getName in interface DataType
Returns:
the parameter name

setPrimaryKey

public void setPrimaryKey(boolean isPrimaryKey)
Specified by:
setPrimaryKey in interface DataType

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: DataType
is primary key?

Specified by:
isPrimaryKey in interface DataType
Returns:
true if this data type is used as a primary key, otherwise false.

setNotNull

public void setNotNull(boolean isNotNull)
Specified by:
setNotNull in interface DataType

isNotNull

public boolean isNotNull()
Description copied from interface: DataType
allowed to be null?

Specified by:
isNotNull in interface DataType
Returns:
true if this data type value cannot be null, otherwise false.

toString

public String toString()
Overrides:
toString in class Object


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.