Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.catalog.types
Class BaseTypeIdImpl  view BaseTypeIdImpl download BaseTypeIdImpl.java

java.lang.Object
  extended byorg.apache.derby.catalog.types.BaseTypeIdImpl
All Implemented Interfaces:
java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, java.io.Serializable, org.apache.derby.iapi.services.io.TypedFormat
Direct Known Subclasses:
DecimalTypeIdImpl, UserDefinedTypeIdImpl

public class BaseTypeIdImpl
extends java.lang.Object
implements org.apache.derby.iapi.services.io.Formatable

This class is the base class for all type ids that are written to the system tables.


Field Summary
protected  int formatId
           
protected  int JDBCTypeId
           
protected  java.lang.String SQLTypeName
          This class implements Formatable.
protected  int wrapperTypeFormatId
           
 
Constructor Summary
  BaseTypeIdImpl()
          niladic constructor.
  BaseTypeIdImpl(int formatId)
          1 argument constructor.
protected BaseTypeIdImpl(java.lang.String SQLTypeName)
          Constructor for an BaseTypeIdImpl
 
Method Summary
 boolean equals(java.lang.Object that)
          we want equals to say if these are the same type id or not.
 int getJDBCTypeId()
          Get the jdbc type id for this type.
 java.lang.String getSQLTypeName()
          Returns the SQL name of the datatype.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 int hashCode()
          Hashcode which works with equals.
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
private  void setTypeIdSpecificInstanceVariables()
           
 boolean systemBuiltIn()
          Does this type id represent a system built-in type?
 java.lang.String toParsableString(org.apache.derby.catalog.TypeDescriptor td)
          Converts this TypeId, given a data type descriptor (including length/precision), to a string.
 java.lang.String toString()
          Format this BaseTypeIdImpl as a String
 boolean userType()
          Does this type id represent a user type?
 int wrapperTypeFormatId()
          Get the format id for the wrapper type id that corresponds to this type id.
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SQLTypeName

protected java.lang.String SQLTypeName
This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method.


JDBCTypeId

protected int JDBCTypeId

formatId

protected int formatId

wrapperTypeFormatId

protected int wrapperTypeFormatId
Constructor Detail

BaseTypeIdImpl

public BaseTypeIdImpl()
niladic constructor. Needed for Formatable interface to work.


BaseTypeIdImpl

public BaseTypeIdImpl(int formatId)
1 argument constructor. Needed for Formatable interface to work.


BaseTypeIdImpl

protected BaseTypeIdImpl(java.lang.String SQLTypeName)
Constructor for an BaseTypeIdImpl

Method Detail

getSQLTypeName

public java.lang.String getSQLTypeName()
Returns the SQL name of the datatype. If it is a user-defined type, it returns the full Java path name for the datatype, meaning the dot-separated path including the package names.


getJDBCTypeId

public int getJDBCTypeId()
Get the jdbc type id for this type. JDBC type can be found in java.sql.Types.


systemBuiltIn

public boolean systemBuiltIn()
Does this type id represent a system built-in type?


toParsableString

public java.lang.String toParsableString(org.apache.derby.catalog.TypeDescriptor td)
Converts this TypeId, given a data type descriptor (including length/precision), to a string. E.g. VARCHAR(30) For most data types, we just return the SQL type name.


userType

public boolean userType()
Does this type id represent a user type?


toString

public java.lang.String toString()
Format this BaseTypeIdImpl as a String


equals

public boolean equals(java.lang.Object that)
we want equals to say if these are the same type id or not.


hashCode

public int hashCode()
Hashcode which works with equals.


wrapperTypeFormatId

public int wrapperTypeFormatId()
Get the format id for the wrapper type id that corresponds to this type id.


getTypeFormatId

public int getTypeFormatId()
Get the formatID which corresponds to this class.

Specified by:
getTypeFormatId in interface org.apache.derby.iapi.services.io.TypedFormat

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this object from a stream of stored objects.

Specified by:
readExternal in interface java.io.Externalizable

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this object to a stream of stored objects.

Specified by:
writeExternal in interface java.io.Externalizable

setTypeIdSpecificInstanceVariables

private void setTypeIdSpecificInstanceVariables()