at.spardat.enterprise.fmt
Class ABcdFmtRange
java.lang.Object
at.spardat.enterprise.fmt.IFmt
at.spardat.enterprise.fmt.ABcdFmt
at.spardat.enterprise.fmt.ABcdFmtDefault
at.spardat.enterprise.fmt.ABcdFmtRange
- All Implemented Interfaces:
- java.lang.Cloneable
- public class ABcdFmtRange
- extends ABcdFmtDefault
Extends ABcdFmt to allow restricting the number range by providing an upper and lower limit.
|
Constructor Summary |
ABcdFmtRange(int maxBeforeC,
int maxAfterC,
int style,
double minVal,
double maxVal,
java.util.Locale l)
Constructs the format object. |
|
Method Summary |
double |
getMaxValue()
Returns the largest value accepted. |
double |
getMinValue()
Returns the smallest value accepted. |
boolean |
isLegalInternal(java.lang.String internal)
Determines if the given string is a legal internal representation. |
java.lang.String |
parse(java.lang.String external)
Tries to transform an external encoding to an internal. |
| Methods inherited from class at.spardat.enterprise.fmt.ABcdFmtDefault |
format, format, getMaxAfterC, getMaxBeforeC, isLegalExternalChar, isOneWay, maxLenOfExternal, parse, set, setMaxAfterC, setMaxBeforeC, setStyle |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ABcdFmtRange
public ABcdFmtRange(int maxBeforeC,
int maxAfterC,
int style,
double minVal,
double maxVal,
java.util.Locale l)
- Constructs the format object.
- 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 unrestrictedstyle - may be DEFAULT, NO_THOUS_SEPS, THOUS_SEPS or NO_NEG. Either NO_THOUS_SEPS or THOUS_SEPS may be specified.minVal - the smallest value acceptedmaxVal - the largest value acceptedl - the Locale. Must not be null.
parse
public java.lang.String parse(java.lang.String external)
throws AParseException
- Description copied from class:
IFmt
- Tries to transform an external encoding to an internal. Must not be called if
isOneWay() yields true.
- Overrides:
parse in class ABcdFmtDefault
- Throws:
AParseException- See Also:
IFmt.parse(String)
isLegalInternal
public boolean isLegalInternal(java.lang.String internal)
- Description copied from class:
IFmt
- Determines if the given string is a legal internal representation.
- Overrides:
isLegalInternal in class ABcdFmtDefault
- See Also:
IFmt.isLegalInternal(String)
getMinValue
public double getMinValue()
- Returns the smallest value accepted.
getMaxValue
public double getMaxValue()
- Returns the largest value accepted.