org.melati.poem
Class SizedAtomPoemType

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

public abstract class SizedAtomPoemType
extends AtomPoemType

An AtomPoemType with a size.


Field Summary
 
Fields inherited from class org.melati.poem.AtomPoemType
sqlTypeName
 
Fields inherited from class org.melati.poem.BasePoemType
nullable
 
Constructor Summary
SizedAtomPoemType(int sqlTypeCode, String sqlTypeName, boolean nullable, int size)
          Constructor with size.
 
Method Summary
 int getSize()
           
static boolean sizeGreaterEqual(int sizeA, int sizeB)
          Compare sizes, taking into account magic value -1.
 SizedAtomPoemType withSize(int newSize)
           
 
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

SizedAtomPoemType

public SizedAtomPoemType(int sqlTypeCode,
                         String sqlTypeName,
                         boolean nullable,
                         int size)
Constructor with size.

Parameters:
sqlTypeCode - SQL TYPE code
sqlTypeName - SQL TYPE name
nullable - whether nullable
size - how big
Method Detail

getSize

public int getSize()
Returns:
the size of this type

withSize

public SizedAtomPoemType withSize(int newSize)
Parameters:
newSize - size of returned field
Returns:
this or clone with new size

sizeGreaterEqual

public static boolean sizeGreaterEqual(int sizeA,
                                       int sizeB)
Compare sizes, taking into account magic value -1.

Parameters:
sizeA - the size of first field
sizeB - the size of second field
Returns:
whether it should be considered bigger


Copyright © 2000-2010 PanEris. All Rights Reserved.