Class NumericFormatDouble
java.lang.Object
com.softwaremining.wrappers.format.Format
com.softwaremining.wrappers.format.AbstractNumericFormat
com.softwaremining.wrappers.format.NumericFormat
com.softwaremining.wrappers.format.NumericFormatCompressed
com.softwaremining.wrappers.format.NumericFormatDouble
Used for representation of DOUBLE PERCISION COMP_1 and COMP_2 variables.
Default behaviour is for it to save in IEEE standards
COMPUTATIONAL-1 or COMP-1
Specified for internal floating-point items (single precision).
COMP-1 items are 4 bytes long. The sign is contained in the first bit
of the leftmost byte and the exponent is contained in the remaining 7
bits. The last 3 bytes contain the mantissa.
COMPUTATIONAL-2 or COMP-2
Specified for internal floating-point items (double precision).
COMP-2 items are 8 bytes long. The sign is contained in the first bit
of the leftmost byte and the remaining 7 bits contain the exponent.
The remaining 7 bytes contain the mantissa.
-
Field Summary
Fields inherited from class com.softwaremining.wrappers.format.NumericFormat
P_onLeft, P_onRight, P_SizeFields inherited from class com.softwaremining.wrappers.format.AbstractNumericFormat
DECIMAL_POINT_ON_SYSTEMFields inherited from class com.softwaremining.wrappers.format.Format
additionalParamsPostfixesMap, justifiedRight, totalRuntime_convertFromDisplayToStorage, totalRuntime_getInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal StringconvertFromCompressedStorageToDisplayFormat(String formattedString) Convert from Storage-Compressed to Display This methods returns the actual stored value, even it is bigger than the defined format.final StringconvertFromDisplayToStorage(double value, boolean[] sizeError) format a value according to the PIC definitionfinal StringconvertFromDisplayToStorage(String _value, boolean[] sizeError) format a value according to the PIC definitionfinal StringconvertFromDisplayToStorage(BigDecimal _value, boolean[] sizeError) format a value according to the PIC definitionfinal StringconvertFromDisplayToStorage(BigInteger _value, boolean[] sizeError) format a value according to the PIC definitionfinal StringconvertFromStorageToDisplayFormat(String formattedString) protected final StringformatHelper(long value, boolean isNegative) used in convertFromDisplayToStorage format helper - format a value according to the PIC definitionfinal ObjectgetSQLObject(String formattedString) static final StringstorageToDisplay(String formattedString) static final doublestorageToDouble(String formattedString) for testing purposes onlyMethods inherited from class com.softwaremining.wrappers.format.NumericFormatCompressed
isCompressedMethods inherited from class com.softwaremining.wrappers.format.NumericFormat
getIntegerSize, getNumberOfDigits, getStorageCellSizeMethods inherited from class com.softwaremining.wrappers.format.AbstractNumericFormat
adjustPercision, getFractionSize, getSystemDecimalPoint, isDecimal, isSignedMethods inherited from class com.softwaremining.wrappers.format.Format
assignJustifiedRight, convertFromDisplayToStorage, convertFromDisplayToStorage, convertFromDisplayToStorage, convertFromDisplayToStorage, getAllFormatInstances, getInstance, getInstance, getPicture, isJustifiedRight, setPicture, toString
-
Constructor Details
-
NumericFormatDouble
-
-
Method Details
-
formatHelper
used in convertFromDisplayToStorage format helper - format a value according to the PIC definition- Parameters:
body-isNegative-- Returns:
-
calculateFormattedCellSize
public final int calculateFormattedCellSize() -
convertFromDisplayToStorage
format a value according to the PIC definition- Overrides:
convertFromDisplayToStoragein classNumericFormatCompressed
-
convertFromDisplayToStorage
format a value according to the PIC definition- Overrides:
convertFromDisplayToStoragein classNumericFormatCompressed
-
convertFromDisplayToStorage
format a value according to the PIC definition- Overrides:
convertFromDisplayToStoragein classNumericFormatCompressed
-
convertFromCompressedStorageToDisplayFormat
Description copied from class:NumericFormatCompressedConvert from Storage-Compressed to Display This methods returns the actual stored value, even it is bigger than the defined format.
E.g. PIC 9(2) COMP can store a value of 30000 ! This method will return "30000", but convertFromStorageToDisplayFormat will return "30".- Specified by:
convertFromCompressedStorageToDisplayFormatin classNumericFormatCompressed- Returns:
-
convertFromStorageToDisplayFormat
- Specified by:
convertFromStorageToDisplayFormatin classFormat
-
convertFromDisplayToStorage
format a value according to the PIC definition- Overrides:
convertFromDisplayToStoragein classNumericFormatCompressed
-
storageToDisplay
-
storageToDouble
for testing purposes only- Parameters:
formattedString-- Returns:
-
getSQLObject
- Overrides:
getSQLObjectin classNumericFormat
-