org.apache.derby.catalog.types
Class DefaultInfoImpl

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

public class DefaultInfoImpl
extends java.lang.Object
implements DefaultInfo, Formatable

See Also:
Serialized Form

Field Summary
private static int BITS_MASK_IS_DEFAULTVALUE_AUTOINC
           
private  java.lang.String defaultText
           
private  DataValueDescriptor defaultValue
          This class implements Formatable.
private  int type
           
 
Constructor Summary
DefaultInfoImpl()
          Public niladic constructor.
DefaultInfoImpl(boolean isDefaultValueAutoinc, java.lang.String defaultText, 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.
 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(DataValueDescriptor defaultValue)
          Set the default value.
 java.lang.String toString()
           
 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 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,
                       DataValueDescriptor defaultValue)
Constructor for use with numeric types

Parameters:
defaultText - The text of the default.
Method Detail

getDefaultText

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

Specified by:
getDefaultText in interface DefaultInfo
Returns:
The text of the default.
See Also:
DefaultInfo.getDefaultText()

toString

public java.lang.String toString()

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
Parameters:
in - read this.
Throws:
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on error

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
Parameters:
out - write bytes here.
Throws:
java.io.IOException - thrown on error

getTypeFormatId

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

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
the formatID of this class

getDefaultValue

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

Returns:
The default value.

setDefaultValue

public void setDefaultValue(DataValueDescriptor defaultValue)
Set the default value.

Parameters:
defaultValue - The default value.
Returns:
Nothing.

isDefaultValueAutoinc

public boolean isDefaultValueAutoinc()
Description copied from interface: DefaultInfo
Is default value generated by auto increment?

Specified by:
isDefaultValueAutoinc in interface DefaultInfo
Returns:
true if always generated by auto increment.
See Also:
DefaultInfo.isDefaultValueAutoinc()

calcType

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


Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.