|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.text.Format
com.davisor.data.Type
com.davisor.data.LocaleType
com.davisor.data.FormatType
com.davisor.data.SimpleNumberType
com.davisor.data.IntegerType
com.davisor.data.IntegerRangeType
IntegerRangeType extends the IntegerType class with the capability to constrain integer values within the given value range.
IntegerData,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary | |
static java.lang.String |
TYPENAME
Type name ("INTRANGE"). |
| Fields inherited from class com.davisor.data.IntegerType |
DEFAULT |
| Fields inherited from class com.davisor.data.FormatType |
M_pattern, M_sample |
| Fields inherited from class com.davisor.data.LocaleType |
DEFAULT_LOCALE, M_locale |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
IntegerRangeType()
Default constructor. |
|
IntegerRangeType(IntegerRangeType irt)
Copy constructor. |
|
IntegerRangeType(java.lang.String dataName)
Creates a new default type with no identity. |
|
IntegerRangeType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
java.lang.Integer lower,
java.lang.Integer upper)
Creates a new integer range type. |
|
IntegerRangeType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Constructs a new restricted range integer data type. |
protected |
IntegerRangeType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
java.lang.Integer lower,
java.lang.Integer upper)
Creates a new integer range type. |
| Method Summary | |
int |
check(int value)
Checks an integer value with the current restricted range. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
java.lang.String |
getFormat()
Gets the type specification string. |
int |
intValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to an integer value while enforcing the current range constraints. |
void |
setFormat(java.lang.String format)
Sets the integer value a restricted range. |
java.lang.String |
stringValue(int value)
Converts an int value to a string while enforcing the current range constraints. |
| Methods inherited from class com.davisor.data.IntegerType |
decode, encode, equals, getSQLCode, getValueClass, toData, toData, toData, toData |
| Methods inherited from class com.davisor.data.SimpleNumberType |
byteValue, byteValue, createFormatter, doubleValue, doubleValue, floatValue, floatValue, intValue, longValue, longValue, numberValue, shortValue, shortValue, stringValue, stringValue, stringValue, stringValue, stringValue, stringValue, zero |
| Methods inherited from class com.davisor.data.FormatType |
clearFormatter, getFormatter, getPattern, getSample, hashCode, setFormat, setLocale, setPattern, setSample |
| Methods inherited from class com.davisor.data.LocaleType |
getLocale, setLocale |
| Methods inherited from class com.davisor.data.Type |
ceil, check, check, compare, create, create, create, create, create, dup, floor, format, getCompatibility, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getSQLName, getTypeName, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toString, toXML, xmlEnd, xmlStart |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String TYPENAME
| Constructor Detail |
public IntegerRangeType()
public IntegerRangeType(IntegerRangeType irt)
public IntegerRangeType(java.lang.String dataName)
dataName - data name (may be null)
public IntegerRangeType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
This is the constructor the SQL type mapper Type.create(Integer,String,String,String) method will call to
create a type that matches given SQL type.
dataName - data name (may be null)id - type identity (may be null)format - integer value range specification (may be null)setFormat(java.lang.String)
public IntegerRangeType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
java.lang.Integer lower,
java.lang.Integer upper)
dataName - data nameid - type identitymetaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)lower - range lower bound, inclusive (may be null)upper - range upper bound, inclusive (may be null)
protected IntegerRangeType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
java.lang.Integer lower,
java.lang.Integer upper)
typeName - type namedataName - data nameid - type identitymetaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)lower - range lower bound, inclusive (may be null)upper - range upper bound, inclusive (may be null)| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class IntegerType
public int check(int value)
throws InvalidDataException
value - integer value
InvalidDataException - if the value is invalid with respect
to current integer value range
public int intValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
intValue in interface NumberTypeintValue in class SimpleNumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value is invalid with respect
to current integer value rangecheck(int),
SimpleNumberType.intValue(String,ParsePosition)
public java.lang.String stringValue(int value)
throws InvalidDataException
stringValue in interface NumberTypestringValue in class SimpleNumberTypevalue - the string to be converted
InvalidDataException - if the value is invalid with respect
to current integer value rangeFormatType.getFormatter()public java.lang.String getFormat()
getFormat in class FormatTypesetFormat(java.lang.String)public void setFormat(java.lang.String format)
setFormat in class FormatTypeformat - type specification string (may be null)getFormat()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||