|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dse.base.FormatElement
com.ibm.dse.base.FieldFormat
com.ibm.dse.base.NumericStringFormat
This class converts an Integer or Long into a formatted String using the java.text.DecimalFormat initialized by attributes of this class.
Field Summary | |
---|---|
java.text.DecimalFormat |
formatter
|
boolean |
showDecimalsSep
The attribute to indicate if the decimal separator must be showed. |
int |
signRule
|
int |
usePositiveSign
|
Fields inherited from class com.ibm.dse.base.FormatElement |
---|
dataElementName, externalizer, name |
Constructor Summary | |
---|---|
NumericStringFormat()
This is the default constructor used to create a NumericStringFormat object. |
|
NumericStringFormat(java.lang.String aName)
This is the constructor used by the Externalizer to create a NumericStringFormat object. |
Method Summary | |
---|---|
java.lang.String |
formatField(DataField aDataField)
Calls the format method of the java.text.DecimalFormat. |
int |
getDecimalPlaces()
Returns the number of decimal digits when the String is formatted. |
char |
getDecimalSeparator()
Returns the value of decimalSeparator. |
boolean |
getShowDecimals()
Returns true if the String formats with decimal places. |
int |
getSignRule()
Returns the value of signRule. |
char |
getThousandsSeparator()
Returns the value of thousandsSeparator. |
int |
getUsePositiveSign()
Returns the value of usePositiveSign. |
boolean |
getUseThousandsSeparator()
Returns true the String formats with a thousands separator. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a NumericStringFormat with the aTag attributes. |
boolean |
isShowDecimalsSep()
Returns the value of the showDecimalsSep property. |
void |
setDecimalPlaces(int anInt)
Sets the value of decimalPlaces of the formatter to anInt. |
void |
setDecimalSeparator(char aDecimalSeparator)
Sets the value of decimalSeparator of the formatter to aDecimalSeparator. |
void |
setShowDecimalsSep(boolean newShowDecimalsSep)
Sets the value of the showDecimalsSep property. |
protected void |
setSignPolicy()
Sets the parameters of the formatter using the values of usePositiveSign and signRule. |
void |
setSignRule(int anInt)
Sets the value of signRule. |
void |
setThousandsSeparator(char aChar)
Sets the value of thousandsSeparator of the formatter to aChar. |
void |
setUsePositiveSign(int anInt)
Set the value of usePositiveSign. |
void |
setUseThousandsSeparator(boolean aBoolean)
Sets the value of useThousandSeparator to aBoolean. |
java.lang.String |
toString()
Returns a visual representation of this format. |
DataField |
unformatField(java.lang.String aString,
DataField aDataField)
Calls the parse method of the java.text.DecimalFormat. |
Methods inherited from class com.ibm.dse.base.FieldFormat |
---|
format, format, toStrings, unformat, unformat |
Methods inherited from class com.ibm.dse.base.FormatElement |
---|
exceptionInfo, externalizer, extract, format, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, 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 |
Field Detail |
public int usePositiveSign
public java.text.DecimalFormat formatter
public int signRule
public boolean showDecimalsSep
Constructor Detail |
public NumericStringFormat()
public NumericStringFormat(java.lang.String aName) throws java.io.IOException
Method Detail |
public java.lang.String formatField(DataField aDataField) throws DSEInvalidArgumentException
formatField
in class FieldFormat
aDataField
- DataField
DSEInvalidArgumentException
public int getDecimalPlaces()
public char getDecimalSeparator()
public boolean getShowDecimals()
public int getSignRule()
public char getThousandsSeparator()
public int getUsePositiveSign()
public boolean getUseThousandsSeparator()
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException
initializeFrom
in interface Externalizable
initializeFrom
in class FormatElement
aTag
- com.ibm.dse.base.Tag
java.io.IOException
public boolean isShowDecimalsSep()
public void setDecimalPlaces(int anInt)
anInt
- intpublic void setDecimalSeparator(char aDecimalSeparator)
aDecimalSeparator
- charpublic void setShowDecimalsSep(boolean newShowDecimalsSep)
newShowDecimalsSep
- boolean - The new value of the propertyprotected void setSignPolicy()
public void setSignRule(int anInt)
public void setThousandsSeparator(char aChar)
public void setUsePositiveSign(int anInt)
anInt
- intpublic void setUseThousandsSeparator(boolean aBoolean)
aBoolean
- booleanpublic java.lang.String toString()
toString
in class FormatElement
public DataField unformatField(java.lang.String aString, DataField aDataField) throws DSEInvalidArgumentException
unformatField
in class FieldFormat
aString
- StringaDataField
- DataField
DSEInvalidArgumentException
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |