com.ibm.as400.ui.framework.java
Class LongFormatter
java.lang.Object
|
+--com.ibm.as400.ui.framework.java.DataFormatter
|
+--com.ibm.as400.ui.framework.java.LongFormatter
- public class LongFormatter
- extends DataFormatter
Formatter for exchanging Long values between
DataBean
s and user interface components.
If parsing is unsuccessful, an IllegalUserDataException
is thrown.
- Since:
- v4r2m0
- See Also:
DataFormatter
,
IllegalUserDataException
Constructor Summary |
LongFormatter(long minValue,
long maxValue)
Constructs a LongFormatter . |
Method Summary |
java.lang.String |
format(int number)
Format a long number based on the current locale |
java.lang.String |
format(java.lang.Object obj)
Format a number as a long based on the current locale
Throws an IllegalArgumentException if the object is not an instance of Long or Integer. |
java.lang.Object |
parse(java.lang.String source)
Parses a string to produce a Long object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LongFormatter
public LongFormatter(long minValue,
long maxValue)
- Constructs a
LongFormatter
.
- Parameters:
minValue
- the minimum value requiredmaxValue
- the maximum value required- Since:
- v4r2m0
parse
public java.lang.Object parse(java.lang.String source)
throws IllegalUserDataException
- Parses a string to produce a
Long
object.
Throws an IllegalUserDataException
if parsing fails.
- Overrides:
parse
in class DataFormatter
- Parameters:
source
- the string to be parsed- Returns:
- the Long object obtained by parsing the string
- Since:
- v4r2m0
format
public java.lang.String format(int number)
- Format a long number based on the current locale
- Parameters:
number
- a valid long
number.- Since:
- v5r1m0
format
public java.lang.String format(java.lang.Object obj)
- Format a number as a long based on the current locale
Throws an IllegalArgumentException if the object is not an instance of Long or Integer.
- Overrides:
format
in class DataFormatter
- Parameters:
obj
- a valid Date
object cast as an object.- Since:
- v5r1m0