org.melati.poem
Class FixedPointAtomPoemType

Package class diagram package FixedPointAtomPoemType
java.lang.Object
  extended by org.melati.poem.BasePoemType<T>
      extended by org.melati.poem.AtomPoemType
          extended by org.melati.poem.FixedPointAtomPoemType
All Implemented Interfaces:
Cloneable, PoemType, SQLPoemType, SQLType
Direct Known Subclasses:
BigDecimalPoemType

public abstract class FixedPointAtomPoemType
extends AtomPoemType

An extension of AtomPoemType which adds precision and scale.


Field Summary
 
Fields inherited from class org.melati.poem.AtomPoemType
sqlTypeName
 
Fields inherited from class org.melati.poem.BasePoemType
nullable
 
Constructor Summary
FixedPointAtomPoemType(int sqlTypeCode, String sqlTypeName, boolean nullable, int precision, int scale)
          Constructor.
 
Method Summary
 int getPrecision()
           
 int getScale()
           
 int getTotalSize()
           
 void setPrecision(int newPrecision)
           
 void setScale(int newScale)
           
 FixedPointAtomPoemType withPrecisionAndScale(int newPrecision, int newScale)
           
 
Methods inherited from class org.melati.poem.AtomPoemType
_assertValidCooked, _cookedOfRaw, _quotedRaw, _rawOfCooked, _sqlDefinition, _stringOfCooked, _stringOfRaw, _toString, sqlDefaultValue
 
Methods inherited from class org.melati.poem.BasePoemType
_assertValidRaw, _canRepresent, _getRaw, _possibleRaws, _rawOfString, _saveColumnInfo, _setRaw, assertValidCooked, assertValidRaw, canRepresent, clone, cookedOfRaw, getLimitRaw, getLowRaw, getNullable, getRaw, possibleRaws, quotedRaw, rawOfCooked, rawOfString, saveColumnInfo, setRaw, setRawRange, sqlDefinition, sqlTypeCode, sqlTypeDefinition, stringOfCooked, stringOfRaw, toString, withNullable
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.melati.poem.PoemType
toDsdType
 

Constructor Detail

FixedPointAtomPoemType

public FixedPointAtomPoemType(int sqlTypeCode,
                              String sqlTypeName,
                              boolean nullable,
                              int precision,
                              int scale)
Constructor.

Parameters:
sqlTypeCode - from Types
sqlTypeName - name of sql type
nullable - whether nulls are allowable values
precision - how many places to the left of decimal point
scale - howmany places to right of decimal point
Method Detail

getTotalSize

public int getTotalSize()
Returns:
precision plus scale

withPrecisionAndScale

public FixedPointAtomPoemType withPrecisionAndScale(int newPrecision,
                                                    int newScale)
Parameters:
newPrecision - required precision
newScale - required scale
Returns:
this or a clone with new values

getPrecision

public int getPrecision()
Returns:
the value of the precision property

getScale

public int getScale()
Returns:
the value of the scale property

setPrecision

public void setPrecision(int newPrecision)
Parameters:
newPrecision - precision to set

setScale

public void setScale(int newScale)
Parameters:
newScale - scale to set


Copyright © 2000-2010 PanEris. All Rights Reserved.