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

Quick Search    Search Deep

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

java.lang.Object
  extended byorg.apache.derby.catalog.types.DefaultInfoImpl
All Implemented Interfaces:
org.apache.derby.catalog.DefaultInfo, java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, java.io.Serializable, org.apache.derby.iapi.services.io.TypedFormat

public class DefaultInfoImpl
extends java.lang.Object
implements org.apache.derby.catalog.DefaultInfo, org.apache.derby.iapi.services.io.Formatable


Field Summary
private static int BITS_MASK_IS_DEFAULTVALUE_AUTOINC
           
private  java.lang.String defaultText
           
private  org.apache.derby.iapi.types.DataValueDescriptor defaultValue
          This class implements Formatable.
private  int type
           
 
Constructor Summary
DefaultInfoImpl()
          Public niladic constructor.
DefaultInfoImpl(boolean isDefaultValueAutoinc, java.lang.String defaultText, org.apache.derby.iapi.types.DataValueDescriptor defaultValue)
          Constructor for use with numeric types
 
Method Summary
private static int calcType(boolean isDefaultValueAutoinc)
          This function returns stored value for flags and so on.
 java.lang.String getDefaultText()
          Get the text of a default.
 org.apache.derby.iapi.types.DataValueDescriptor getDefaultValue()
          Get the default value.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 boolean isDefaultValueAutoinc()
          Is default value generated by auto increment?
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
 void setDefaultValue(org.apache.derby.iapi.types.DataValueDescriptor defaultValue)
          Set the default value.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultValue

private org.apache.derby.iapi.types.DataValueDescriptor defaultValue
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.


defaultText

private java.lang.String defaultText

type

private int type

BITS_MASK_IS_DEFAULTVALUE_AUTOINC

private static final int BITS_MASK_IS_DEFAULTVALUE_AUTOINC
See Also:
Constant Field Values
Constructor Detail

DefaultInfoImpl

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


DefaultInfoImpl

public DefaultInfoImpl(boolean isDefaultValueAutoinc,
                       java.lang.String defaultText,
                       org.apache.derby.iapi.types.DataValueDescriptor defaultValue)
Constructor for use with numeric types

Method Detail

getDefaultText

public java.lang.String getDefaultText()
Description copied from interface: org.apache.derby.catalog.DefaultInfo
Get the text of a default.

Specified by:
getDefaultText in interface org.apache.derby.catalog.DefaultInfo

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


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

getTypeFormatId

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

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

getDefaultValue

public org.apache.derby.iapi.types.DataValueDescriptor getDefaultValue()
Get the default value. (NOTE: This returns null if the default is not a constant.)


setDefaultValue

public void setDefaultValue(org.apache.derby.iapi.types.DataValueDescriptor defaultValue)
Set the default value.


isDefaultValueAutoinc

public boolean isDefaultValueAutoinc()
Description copied from interface: org.apache.derby.catalog.DefaultInfo
Is default value generated by auto increment?

Specified by:
isDefaultValueAutoinc in interface org.apache.derby.catalog.DefaultInfo

calcType

private static int calcType(boolean isDefaultValueAutoinc)
This function returns stored value for flags and so on.