IMC Epclient 5.0.3

at.spardat.enterprise.fmt
Class ABcdFmt

java.lang.Object
  extended byat.spardat.enterprise.fmt.IFmt
      extended byat.spardat.enterprise.fmt.ABcdFmt
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ABcdFmtDefault

public abstract class ABcdFmt
extends IFmt

A IFmt class capable of formatting and parsing numbers. It's tailored towards the class ABcd and expoits its internal string representation. Therefore, the internal string representation is the canonic one of an ABcd object.


Field Summary
static int NO_NEG
          NO_NEG is specified if negative numbers are not allowed.
static int NO_THOUS_SEPS
          The default is formatting without thousands separation characters, as is used with numbers.
static int ROUND_FRACTION
          Specifies that an excess number of places after the decimal separator should not be treated as error in parse.
static int SUPPRESS_ZERO
          Defines that a value of zero should be displayed as empty string on the UI and, vice versa, that an empty string on the UI should be mapped to a zero numeric value.
static int THOUS_SEPS
          THOUS_SEPS is the style to enforce the usage of thousands separation characters.
 
Fields inherited from class at.spardat.enterprise.fmt.IFmt
DEFAULT, LAST_STYLE, MANDATORY, style_
 
Constructor Summary
protected ABcdFmt()
           
 
Method Summary
static ABcdFmt getInstance(int maxBeforeC, int maxAfterC, int style, double minVal, double maxVal, java.util.Locale locale)
          Factory method that returns an internationalization capable instance of ABcdFmt, where upper and lower limits for the accepted value are provided.
static ABcdFmt getInstance(int maxBeforeC, int maxAfterC, int style, java.util.Locale locale)
          Factory method that returns an internationalization capable instance of ABcdFmt.
static ABcdFmt getInstance(java.lang.String pattern, int maxBeforeC, int maxAfterC, int style, java.util.Locale locale)
          Factory method that returns an instance of ABcdFmt that is specified using a format-string as defined in java.text.DecimalFormat.
 boolean mayBeAppliedTo(byte type)
          Defines if this formatter is able to successfully format a specified type.
 
Methods inherited from class at.spardat.enterprise.fmt.IFmt
checkMandatory, clone, format, getStyle, isLegalExternalChar, isLegalInternal, isMandatory, isOneWay, maxLenOfExternal, parse, setMandatory
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_THOUS_SEPS

public static final int NO_THOUS_SEPS
The default is formatting without thousands separation characters, as is used with numbers.

See Also:
Constant Field Values

THOUS_SEPS

public static final int THOUS_SEPS
THOUS_SEPS is the style to enforce the usage of thousands separation characters.

See Also:
Constant Field Values

NO_NEG

public static final int NO_NEG
NO_NEG is specified if negative numbers are not allowed.

See Also:
Constant Field Values

ROUND_FRACTION

public static final int ROUND_FRACTION
Specifies that an excess number of places after the decimal separator should not be treated as error in parse. The value should be rounded to the right number of decimal places before and afterwards be assigned.

The default is to be strict, i.e., not to allow excess number of digits after the comma.

See Also:
Constant Field Values

SUPPRESS_ZERO

public static final int SUPPRESS_ZERO
Defines that a value of zero should be displayed as empty string on the UI and, vice versa, that an empty string on the UI should be mapped to a zero numeric value.

See Also:
Constant Field Values
Constructor Detail

ABcdFmt

protected ABcdFmt()
Method Detail

getInstance

public static ABcdFmt getInstance(int maxBeforeC,
                                  int maxAfterC,
                                  int style,
                                  java.util.Locale locale)
Factory method that returns an internationalization capable instance of ABcdFmt.

Parameters:
maxBeforeC - max number of digits before the comma or -1 if unrestricted. Must not be zero.
maxAfterC - max number of digits after the comma or -1 if unrestricted
style - may be DEFAULT, SUPPRESS_ZERO, MANDATORY, NO_THOUS_SEPS, THOUS_SEPS or NO_NEG. Either NO_THOUS_SEPS or THOUS_SEPS may be specified.
Returns:
A newly created IFmt object.

getInstance

public static ABcdFmt getInstance(int maxBeforeC,
                                  int maxAfterC,
                                  int style,
                                  double minVal,
                                  double maxVal,
                                  java.util.Locale locale)
Factory method that returns an internationalization capable instance of ABcdFmt, where upper and lower limits for the accepted value are provided.

Parameters:
maxBeforeC - max number of digits before the comma or -1 if unrestricted. Must not be zero.
maxAfterC - max number of digits after the comma or -1 if unrestricted
style - may be DEFAULT, SUPPRESS_ZERO, MANDATORY, NO_THOUS_SEPS, THOUS_SEPS or NO_NEG. Either NO_THOUS_SEPS or THOUS_SEPS may be specified.
minVal - values less than this value are not accepted.
maxVal - values greater than this value are not accepted.
Returns:
A newly created IFmt object.

getInstance

public static ABcdFmt getInstance(java.lang.String pattern,
                                  int maxBeforeC,
                                  int maxAfterC,
                                  int style,
                                  java.util.Locale locale)
Factory method that returns an instance of ABcdFmt that is specified using a format-string as defined in java.text.DecimalFormat.

Parameters:
pattern - format string accoring to java.text.DecimalFormat
style - may be MANDATORY
locale - the Locale. Must not be null.
Returns:
A newly created ABcdFmt.

mayBeAppliedTo

public boolean mayBeAppliedTo(byte type)
Description copied from class: IFmt
Defines if this formatter is able to successfully format a specified type.

Specified by:
mayBeAppliedTo in class IFmt
Parameters:
type - a type constant defined in Types.
See Also:
IFmt.mayBeAppliedTo(byte)

IMC Epclient 5.0.3