java.lang.String |
formatField(DataField aDataField)
Methods inherited from class com.ibm.btt.base.FormatElement |
checkIndexes, exceptionInfo, externalizer, extract, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, isNull, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toTags, unformat, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
usePositiveSign
public int usePositiveSign
- The sign for the use of the positive sign.
formatter
public java.text.DecimalFormat formatter
- The internal formatter used for the conversion between the decimal and
the string.
signRule
public int signRule
- The rule used to display the sign.
showDecimalsSep
public boolean showDecimalsSep
- The attribute to indicate if the decimal separator must be showed.*
NumericStringFormat
public NumericStringFormat()
- This is the default constructor used to create a NumericStringFormat
object.
NumericStringFormat
public NumericStringFormat(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the Externalizer to create a
NumericStringFormat object.
- Throws:
java.io.IOException
formatField
public java.lang.String formatField(DataField aDataField)
throws DSEInvalidArgumentException
- Calls the format method of the java.text.DecimalFormat.
- Specified by:
formatField in class FieldFormat
- Parameters:
aDataField - DataField
- Returns:
- String
- Throws:
DSEInvalidArgumentException
getDecimalPlaces
public int getDecimalPlaces()
- Returns the number of decimal digits when the String is formatted.
- Returns:
- int
getDecimalSeparator
public char getDecimalSeparator()
- Returns the value of decimalSeparator.
- Returns:
- char
getShowDecimals
public boolean getShowDecimals()
- Returns true if the String formats with decimal places.
- Returns:
- boolean
getSignRule
public int getSignRule()
- Returns the value of signRule.
- Returns:
- int
getThousandsSeparator
public char getThousandsSeparator()
- Returns the value of thousandsSeparator.
- Returns:
- char
getUsePositiveSign
public int getUsePositiveSign()
- Returns the value of usePositiveSign.
- Returns:
- int
getUseThousandsSeparator
public boolean getUseThousandsSeparator()
- Returns true the String formats with a thousands separator.
- Returns:
- boolean
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException
- Initializes a NumericStringFormat with the aTag attributes.
- Specified by:
initializeFrom in class FormatElement
- Parameters:
aTag - com.ibm.btt.base.Tag
- Returns:
- java.lang.Object
- Throws:
java.io.IOException
isShowDecimalsSep
public boolean isShowDecimalsSep()
- Returns the value of the showDecimalsSep property.
- Returns:
- boolean - The current value of showDecimalsSep.
setDecimalPlaces
public void setDecimalPlaces(int anInt)
- Sets the value of decimalPlaces of the formatter to anInt.
- Parameters:
anInt - int
setDecimalSeparator
public void setDecimalSeparator(char aDecimalSeparator)
- Sets the value of decimalSeparator of the formatter to aDecimalSeparator.
- Parameters:
aDecimalSeparator - char
setShowDecimalsSep
public void setShowDecimalsSep(boolean newShowDecimalsSep)
- Sets the value of the showDecimalsSep property.
- Parameters:
newShowDecimalsSep - boolean - The new value of the property
setSignPolicy
protected void setSignPolicy()
- Sets the parameters of the formatter using the values of usePositiveSign
and signRule. It is called by the setSignRule() and setUsePositiveSign()
methods.
setSignRule
public void setSignRule(int anInt)
- Sets the value of signRule. The following values should be used as the
parameter:
1 = prefix ==> -123 <+>123 2 = suffix ==> 123- 123<+> 3 = parentheses
==> (123) 123
setThousandsSeparator
public void setThousandsSeparator(char aChar)
- Sets the value of thousandsSeparator of the formatter to aChar.
- Parameters:
aChar - char
setUsePositiveSign
public void setUsePositiveSign(int anInt)
- Set the value of usePositiveSign. The following values should be used as
the parameter:
1 = no ==> '-123' '123' or '123-' '123' 2 = yes ==> '-123' '+123' or
'123-' '123+' 3 = blank ==> '-123' ' 123' or '123-' '123 '
- Parameters:
anInt - int
setUseThousandsSeparator
public void setUseThousandsSeparator(boolean aBoolean)
- Sets the value of useThousandSeparator to aBoolean.
- Parameters:
aBoolean - boolean
toString
public java.lang.String toString()
- Returns a visual representation of this format.
- Overrides:
toString in class FormatElement
- Returns:
- java.lang.String
unformatField
public DataField unformatField(java.lang.String aString,
DataField aDataField)
throws DSEInvalidArgumentException
- Calls the parse method of the java.text.DecimalFormat.
- Specified by:
unformatField in class FieldFormat
- Parameters:
aString - StringaDataField - DataField
- Returns:
- DataField
- Throws:
DSEInvalidArgumentException
(c) Copyright IBM Corporation 1998, 2009
|