biz.c24.io.api.data
Class NumberDataType

java.lang.Object
  extended by biz.c24.io.api.data.DataType
      extended by biz.c24.io.api.data.SimpleDataType
          extended by biz.c24.io.api.data.AtomicDataType
              extended by biz.c24.io.api.data.NumberDataType
All Implemented Interfaces:
FormatableDataType, ModelComponent, Serializable
Direct Known Subclasses:
DecimalDataType, DoubleDataType

public abstract class NumberDataType
extends AtomicDataType
implements FormatableDataType

A simple data type representing a number.

Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class biz.c24.io.api.data.AtomicDataType
AtomicDataType.FinalEnum
 
Field Summary
static int DIGITS_UNBOUNDED
          The value of a digit count that is unbounded.
protected  biz.c24.io.api.data.FormatPool formatPool
           
 
Fields inherited from class biz.c24.io.api.data.DataType
duringParsing, hasEnumerations, hasPatternMatching, qualifierValidation
 
Method Summary
 Format createFormat(int idx)
          Returns the format with specified index.
 String[] getAllFormatPatterns()
          Returns the format pattern(s).
 int getBitLength()
          Returns the bit length.
 String getCurrencySymbol()
          Returns the currency symbol.
 char getDecimalSeparator()
          Returns the decimal separator.
 String getFormatPattern()
          Returns the main format pattern.
 int getFormatsCount()
          Returns the defined formats count or 0 if there is no any.
 String getInternationalCurrencySymbol()
          Returns the international currency symbol.
 Object getMaxExclusive()
          Returns the maximum exclusive value (optional operation).
 int getMaxFractionDigits()
          Returns the maximum fraction digits.
 Object getMaxInclusive()
          Returns the maximum inclusive value (optional operation).
 int getMaxIntegerDigits()
          Returns the maximum integer digits.
 int getMaxSize()
          Returns the maximum allowable size of the value.
 int getMaxTotalDigits()
          Returns the maximum total digits.
 Object getMinExclusive()
          Returns the minimum exclusive value (optional operation).
 int getMinFractionDigits()
          Returns the minimum fraction digits.
 Object getMinInclusive()
          Returns the minimum inclusive value (optional operation).
 int getMinIntegerDigits()
          Returns the minimum integer digits.
 int getMinSize()
          Returns the minimum allowable size of the value.
 int getMinTotalDigits()
          Returns the minimum total digits.
 char getMinusSign()
          Returns the minus sign.
 char getMonetaryDecimalSeparator()
          Returns the monetary decimal separator.
 NumberPatternInstanceEnum getPatternInstance()
          Returns the pattern instance to use when localised.
 char getPercentSign()
          Returns the percent sign.
 char getPermillSign()
          Returns the permill sign.
 char getThousandSign()
          Returns the thousand separator.
 Class getValidObjectClass()
          Returns the class of valid objects of this type.
 boolean isDecimalSeparatorAlwaysShown()
          Returns whether the decimal separator is always shown.
 boolean isDecimalSeparatorNeverShown()
          Returns whether the decimal separator is never shown.
 boolean isFormatUsed()
          Returns whether this type is using a number format.
 Object parseObject(String str, boolean external)
          Parses the supplied str into an object, possibly using the protected parseObjectExternal(String, java.text.ParsePosition) method.
 Object parseObject(String str, boolean external, ParsePosition pp)
          Parses an object from str using the supplied parse position.
 void setAllFormatPatterns(String[] formatPattern)
          Sets the format pattern(s).
 void setBitLength(int bitLength)
          Sets the bit length.
 void setCurrencySymbol(String currencySymbol)
          Sets the currency symbol.
 void setDecimalSeparator(char decimalSeparator)
          Sets the decimal separator.
 void setDecimalSeparatorAlwaysShown(boolean decimalSeparatorAlwaysShown)
          Sets whether the decimal separator is always shown.
 void setDecimalSeparatorNeverShown(boolean display)
          Sets whether the decimal separator is never shown.
 void setFormatPattern(String formatPattern)
          Sets the main format pattern.
 void setInternationalCurrencySymbol(String internationalCurrencySymbol)
          Sets the international currency symbol.
 void setMaxExclusive(Object maxExclusive)
          Sets the maximum exclusive value (optional operation).
 void setMaxFractionDigits(int maxFractionDigits)
          Sets the maximum fraction digits.
 void setMaxInclusive(Object maxInclusive)
          Sets the maximum inclusive value (optional operation).
 void setMaxIntegerDigits(int maxIntegerDigits)
          Sets the maximum integer digits.
 void setMaxTotalDigits(int maxTotalDigits)
          Sets the maximum total digits.
 void setMinExclusive(Object minExclusive)
          Sets the minimum exclusive value (optional operation).
 void setMinFractionDigits(int minFractionDigits)
          Sets the minimum fraction digits.
 void setMinInclusive(Object minInclusive)
          Sets the minimum inclusive value (optional operation).
 void setMinIntegerDigits(int minIntegerDigits)
          Sets the minimum integer digits.
 void setMinTotalDigits(int minTotalDigits)
          Sets the minimum total digits.
 void setMinusSign(char minusSign)
          Sets the minus sign.
 void setMonetaryDecimalSeparator(char monetaryDecimalSeparator)
          Sets the monetay decimal separator.
 void setPatternInstance(NumberPatternInstanceEnum patternInstance)
          Sets the pattern instance to use when localised.
 void setPercentSign(char percentSign)
          Sets the percent sign.
 void setPermillSign(char permillSign)
          Sets the permill sign.
 void setThousandSeparator(char thousandSeparator)
          Sets the thouand separator.
 boolean validateProperties(Object object, DataComponent comp, ComplexDataObject context, ValidationManager manager)
           
 
Methods inherited from class biz.c24.io.api.data.AtomicDataType
formatObject, formatObjectOverride, getFinal, getLocale, getPad, getPadAmount, getPadJustification, getWhiteSpace, setFinal, setLocale, setPad, setPadAmount, setPadJustification, setWhiteSpace
 
Methods inherited from class biz.c24.io.api.data.SimpleDataType
formatObject, formatObjectExternal, getInstance, isComplex, isSimple, isSizeFixed, parseObject, parseObjectExternal
 
Methods inherited from class biz.c24.io.api.data.DataType
addDerivedType, addValidator, addValidator, derivedTypeKeySet, getAnnotation, getDatabaseColumnName, getDerivedType, getDerivedType, getDerivedTypes, getDescription, getEnumeration, getInitiator, getModel, getName, getNullDefiningElementDecl, getOriginalName, getOriginalPatternMatch, getPatternMatch, getPatternType, getTerminator, getValidator, getValidatorCount, getValidatorIndex, hasDerivedTypes, isLocal, isValidObjectClass, removeDerivedType, removeValidator, setAnnotation, setDatabaseColumnName, setInitiator, setLocal, setModel, setName, setOriginalName, setOriginalPatternMatch, setPatternMatch, setPatternType, setTerminator, toString, validate, validateProperties, validateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIGITS_UNBOUNDED

public static final int DIGITS_UNBOUNDED
The value of a digit count that is unbounded.

See Also:
Constant Field Values

formatPool

protected transient biz.c24.io.api.data.FormatPool formatPool
Method Detail

getFormatPattern

public String getFormatPattern()
Returns the main format pattern.

Returns:
The format pattern.

getAllFormatPatterns

public String[] getAllFormatPatterns()
Returns the format pattern(s). Any item in the returned array is considered a valid pattern for parsing but the first item will always be used when formatting. The array returned by this method will never be of length 0, it will be null if no patterns have been specified.

Returns:
The format pattern(s).

setFormatPattern

public void setFormatPattern(String formatPattern)
Sets the main format pattern.

Parameters:
formatPattern - The format pattern.

setAllFormatPatterns

public void setAllFormatPatterns(String[] formatPattern)
Sets the format pattern(s).

Parameters:
formatPattern - The valid format pattern(s).

getPatternInstance

public NumberPatternInstanceEnum getPatternInstance()
Returns the pattern instance to use when localised.

Returns:
The instance.

setPatternInstance

public void setPatternInstance(NumberPatternInstanceEnum patternInstance)
Sets the pattern instance to use when localised.

Parameters:
patternInstance - The instance.

getCurrencySymbol

public String getCurrencySymbol()
Returns the currency symbol.

Returns:
The currency symbol.

setCurrencySymbol

public void setCurrencySymbol(String currencySymbol)
Sets the currency symbol.

Parameters:
currencySymbol - The currency symbol.

getInternationalCurrencySymbol

public String getInternationalCurrencySymbol()
Returns the international currency symbol.

Returns:
The international currency symbol.

setInternationalCurrencySymbol

public void setInternationalCurrencySymbol(String internationalCurrencySymbol)
Sets the international currency symbol.

Parameters:
internationalCurrencySymbol - The international currency symbol.

getMinusSign

public char getMinusSign()
Returns the minus sign.

Returns:
The minus sign.

setMinusSign

public void setMinusSign(char minusSign)
Sets the minus sign.

Parameters:
minusSign - The minus sign.

getPercentSign

public char getPercentSign()
Returns the percent sign.

Returns:
The percent sign.

setPercentSign

public void setPercentSign(char percentSign)
Sets the percent sign.

Parameters:
percentSign - The percent sign.

getPermillSign

public char getPermillSign()
Returns the permill sign.

Returns:
The permill sign.

setPermillSign

public void setPermillSign(char permillSign)
Sets the permill sign.

Parameters:
permillSign - The permill sign.

getThousandSign

public char getThousandSign()
Returns the thousand separator.

Returns:
The thousand separator.

setThousandSeparator

public void setThousandSeparator(char thousandSeparator)
Sets the thouand separator.

Parameters:
thousandSeparator - The thousand separator.

getDecimalSeparator

public char getDecimalSeparator()
Returns the decimal separator.

Returns:
The decimal separator.

setDecimalSeparator

public void setDecimalSeparator(char decimalSeparator)
Sets the decimal separator.

Parameters:
decimalSeparator - The decimal separator.

getMonetaryDecimalSeparator

public char getMonetaryDecimalSeparator()
Returns the monetary decimal separator.

Returns:
The monetary decimal separator.

setMonetaryDecimalSeparator

public void setMonetaryDecimalSeparator(char monetaryDecimalSeparator)
Sets the monetay decimal separator.

Parameters:
monetaryDecimalSeparator - The monetary decimal separator.

isDecimalSeparatorAlwaysShown

public boolean isDecimalSeparatorAlwaysShown()
Returns whether the decimal separator is always shown.

Returns:
Whether the decimal separator is always shown.

setDecimalSeparatorAlwaysShown

public void setDecimalSeparatorAlwaysShown(boolean decimalSeparatorAlwaysShown)
Sets whether the decimal separator is always shown.

Parameters:
decimalSeparatorAlwaysShown - Whether the decimal separator is always shown.

isDecimalSeparatorNeverShown

public boolean isDecimalSeparatorNeverShown()
Returns whether the decimal separator is never shown.

Returns:
Whether the decimal separator is never shown.

setDecimalSeparatorNeverShown

public void setDecimalSeparatorNeverShown(boolean display)
Sets whether the decimal separator is never shown.

Parameters:
display - Whether the decimal separator is never shown.

getMaxFractionDigits

public int getMaxFractionDigits()
Returns the maximum fraction digits.

Returns:
The maximum fraction digits.

getMaxIntegerDigits

public int getMaxIntegerDigits()
Returns the maximum integer digits.

Returns:
The maximum integer digits.

setMaxIntegerDigits

public void setMaxIntegerDigits(int maxIntegerDigits)
Sets the maximum integer digits.

Parameters:
maxIntegerDigits - The maximum integer digits, or DIGITS_UNBOUNDED if there is no limit.
Throws:
IllegalArgumentException - if maxIntegerDigits < 0 && maxIntegerDigits != DIGITS_UNBOUNDED.

getMinIntegerDigits

public int getMinIntegerDigits()
Returns the minimum integer digits.

Returns:
The minimum integer digits.

setMinIntegerDigits

public void setMinIntegerDigits(int minIntegerDigits)
Sets the minimum integer digits.

Parameters:
minIntegerDigits - The minimum integer digits.
Throws:
IllegalArgumentException - if minIntegerDigits < 0

setMaxFractionDigits

public void setMaxFractionDigits(int maxFractionDigits)
Sets the maximum fraction digits.

Parameters:
maxFractionDigits - The maximum fraction digits.
Throws:
IllegalArgumentException - if maxFractionDigits < 0 and maxFractionDigits != DIGITS_UNBOUNDED.

getMinFractionDigits

public int getMinFractionDigits()
Returns the minimum fraction digits.

Returns:
The minimum fraction digits.

setMinFractionDigits

public void setMinFractionDigits(int minFractionDigits)
Sets the minimum fraction digits.

Parameters:
minFractionDigits - The minimum fraction digits.
Throws:
IllegalArgumentException - if minFractionDigits < 0

getMaxTotalDigits

public int getMaxTotalDigits()
Returns the maximum total digits.

Returns:
The maximum fraction digits.

setMaxTotalDigits

public void setMaxTotalDigits(int maxTotalDigits)
Sets the maximum total digits.

Parameters:
maxTotalDigits - The maximum total digits.
Throws:
IllegalArgumentException - if maxTotalDigits < 0 and maxTotalDigits != DIGITS_UNBOUNDED.

getMinTotalDigits

public int getMinTotalDigits()
Returns the minimum total digits.

Returns:
The minimum fraction digits.

setMinTotalDigits

public void setMinTotalDigits(int minTotalDigits)
Sets the minimum total digits.

Parameters:
minTotalDigits - The minimum fraction digits.
Throws:
IllegalArgumentException - if minTotalDigits < 0

getMaxInclusive

public Object getMaxInclusive()
Description copied from class: SimpleDataType
Returns the maximum inclusive value (optional operation).

Overrides:
getMaxInclusive in class SimpleDataType
Returns:
The maximum inclusive value.

setMaxInclusive

public void setMaxInclusive(Object maxInclusive)
Description copied from class: SimpleDataType
Sets the maximum inclusive value (optional operation).

Overrides:
setMaxInclusive in class SimpleDataType
Parameters:
maxInclusive - The maximum inclusive value.

getMinInclusive

public Object getMinInclusive()
Description copied from class: SimpleDataType
Returns the minimum inclusive value (optional operation).

Overrides:
getMinInclusive in class SimpleDataType
Returns:
The minimum inclusive value.

setMinInclusive

public void setMinInclusive(Object minInclusive)
Description copied from class: SimpleDataType
Sets the minimum inclusive value (optional operation).

Overrides:
setMinInclusive in class SimpleDataType
Parameters:
minInclusive - The minimum inclusive value.

getMaxExclusive

public Object getMaxExclusive()
Description copied from class: SimpleDataType
Returns the maximum exclusive value (optional operation).

Overrides:
getMaxExclusive in class SimpleDataType
Returns:
The maximum exclusive value.

setMaxExclusive

public void setMaxExclusive(Object maxExclusive)
Description copied from class: SimpleDataType
Sets the maximum exclusive value (optional operation).

Overrides:
setMaxExclusive in class SimpleDataType
Parameters:
maxExclusive - The maximum exclusive value.

getMinExclusive

public Object getMinExclusive()
Description copied from class: SimpleDataType
Returns the minimum exclusive value (optional operation).

Overrides:
getMinExclusive in class SimpleDataType
Returns:
The minimum exclusive value.

setMinExclusive

public void setMinExclusive(Object minExclusive)
Description copied from class: SimpleDataType
Sets the minimum exclusive value (optional operation).

Overrides:
setMinExclusive in class SimpleDataType
Parameters:
minExclusive - The minimum exclusive value.

getMinSize

public int getMinSize()
Description copied from class: SimpleDataType
Returns the minimum allowable size of the value.

Overrides:
getMinSize in class SimpleDataType
Returns:
The minimum size.

getMaxSize

public int getMaxSize()
Description copied from class: SimpleDataType
Returns the maximum allowable size of the value.

Overrides:
getMaxSize in class SimpleDataType
Returns:
The maximum size or -1 if the size is unbounded.

isFormatUsed

public boolean isFormatUsed()
Returns whether this type is using a number format.

Returns:
Whether a number format is present.

getBitLength

public int getBitLength()
Returns the bit length.

Returns:
The bit length.

setBitLength

public void setBitLength(int bitLength)
Sets the bit length.

Parameters:
bitLength - The new value.

getValidObjectClass

public Class getValidObjectClass()
Description copied from class: DataType
Returns the class of valid objects of this type.

Overrides:
getValidObjectClass in class SimpleDataType
Returns:
The class.

validateProperties

public boolean validateProperties(Object object,
                                  DataComponent comp,
                                  ComplexDataObject context,
                                  ValidationManager manager)
                           throws ValidationException
Overrides:
validateProperties in class SimpleDataType
Throws:
ValidationException

parseObject

public Object parseObject(String str,
                          boolean external)
                   throws ParserException
Description copied from class: SimpleDataType
Parses the supplied str into an object, possibly using the protected parseObjectExternal(String, java.text.ParsePosition) method.

Overrides:
parseObject in class AtomicDataType
Parameters:
str - The string to be parsed.
external - Whether the parseObjectExternal(String, java.text.ParsePosition) method should be used.
Returns:
The object.
Throws:
ParserException - If the parsing failed.

parseObject

public final Object parseObject(String str,
                                boolean external,
                                ParsePosition pp)
Parses an object from str using the supplied parse position. The parse position is used to determine where parsing should start and to notify the calling method of where parsing finished. Note: this method does not force the parse process to use the entire input string.

Parameters:
str - The string to be parsed.
external - Whether the parseObjectExternal(String, java.text.ParsePosition) method should be used.
pp - The parse position.
Returns:
The object if one was parsed, null otherwise.

getFormatsCount

public int getFormatsCount()
Returns the defined formats count or 0 if there is no any.

Specified by:
getFormatsCount in interface FormatableDataType
Returns:
The defined formats count.

createFormat

public Format createFormat(int idx)
Description copied from interface: FormatableDataType
Returns the format with specified index.

Specified by:
createFormat in interface FormatableDataType
Parameters:
idx - The index of requested format.
Returns:
The requested format.


C24 Technologies © 2002-2012: All Rights Reserved.