Class NumericFormatDisplay
java.lang.Object
com.softwaremining.wrappers.format.Format
com.softwaremining.wrappers.format.AbstractNumericFormat
com.softwaremining.wrappers.format.NumericFormat
com.softwaremining.wrappers.format.NumericFormatDisplay
- All Implemented Interfaces:
NumericEditedDisplay
- Direct Known Subclasses:
NumericFormatDisplayLeadingSign,NumericFormatDisplaySeparateSign,NumericFormatDisplayTrailingSeparateSign,NumericFormatDisplayTrailingSign
Provides a formatter that emulates COBOL's Numeric-Display PICTURE functionality in Java.
Given a pattern containing digit positions (9), sign indicators (S), implied decimal markers (V),
and repetition markers (n), this class renders a numeric value by:
1) mapping digits to fixed positions, filling with zeros when necessary
2) scaling values according to implied decimal positions (V)
3) placing sign characters based on S indicators
4) enforcing fixed field widths via repetition counts
This implementation delivers a precise, high-performance Java equivalent
of COBOL's numeric-display formatting for use in mission-critical data-conversion workflows.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal 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) final booleanbooleanFor internal use only.booleanfor internal use only ...booleanFor internal use only.Methods inherited from class com.softwaremining.wrappers.format.NumericFormat
getIntegerSize, getNumberOfDigits, getSQLObject, 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
-
Method Details
-
calculateFormattedCellSize
public final int calculateFormattedCellSize() -
isCompressed
public final boolean isCompressed()- Specified by:
isCompressedin classFormat
-
convertFromDisplayToStorage
format a value according to the PIC definition- Specified by:
convertFromDisplayToStoragein classFormat
-
convertFromDisplayToStorage
format a value according to the PIC definition- Specified by:
convertFromDisplayToStoragein classFormat
-
convertFromDisplayToStorage
format a value according to the PIC definition- Specified by:
convertFromDisplayToStoragein classFormat
-
convertFromDisplayToStorage
Description copied from class:Formatformat a value according to the PIC definition- Specified by:
convertFromDisplayToStoragein classFormat
-
convertFromStorageToDisplayFormat
- Specified by:
convertFromStorageToDisplayFormatin classFormat
-
isSignSeparate
public boolean isSignSeparate()for internal use only ... subclasses may override this
used for declarations such as:
PIC S9(2) sign is SEPARATE.
By default sign is not separate. -
isSignTrailing
public boolean isSignTrailing()For internal use only. Subclasses may override this Used for declarations such as: PIC S9(2) sign is TRAILING. By default sign is not trailing -
isSignLeading
public boolean isSignLeading()For internal use only. Subclasses may override this Used for declarations such as: PIC S9(2) sign is LEADING. By default sign is not trailing
-