|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.util.Tool
Define methods related with date and number convertions used in credit cards.
Field Summary | |
protected static DecimalFormat |
dc
Variable for decimal format definition |
protected static char |
decimalSeparator
Decimal seperator of decimal numbers |
protected static char |
groupingSeparator
Grouping seperator of decimal numbers |
protected static String |
stcDefaultBdFormat
default format field format for big decimals |
protected static int |
stcRoundingMode
Round mode |
protected static int |
stcScale
Scale |
Constructor Summary | |
Tool()
Constructor. |
Method Summary | |
static String |
bigDecimalToString(BigDecimal bd)
Returns a date object from the given day, month and year value |
static boolean |
dateValidation(String day,
String month,
String year)
Checks a date from the given day, month and year values. |
static String |
formatBigDecimalString(String bdString)
Returns a date object from the given day, month and year value |
static BigDecimal |
getBigDecimal(String bdString)
Returns a date object from the given day, month and year value |
static Date |
getDate(String day,
String month,
String year)
Returns a date object from the given day, month and year value. |
static double |
getDouble(String str)
converts a String number to a double value |
static int |
getInt(String str)
converts a String number to a int value |
static long |
getLong(String str)
converts a String number to a long value |
static String |
getRandomDigits(int numberOfDigits)
Get a string with N random digits. |
static String |
getRandomDigits(int numberOfDigits,
int seed)
Get a string with N random digits. |
static String |
getRandomLetters(int numberOfLetters,
int seed)
Get N random uppercase letters. |
static String |
getRandomMixedLetters(int numberOfLetters,
int seed)
Get N random mixed uppercase and lowercase letters. |
static int |
getRoundingMode()
Returns the roundingMode used for bigDecimal |
static int |
getScale()
Returns the scale used for bigDecimal |
static Date |
monthYearToDate(String monthYear)
Returns the date object from the given month and year values. (for the credit card) |
static Integer |
parseInt(String str)
converts a String number to a Integer value |
static void |
setBigDecimalFormatPattern(String pattern)
Sets the pattern used to format a string |
static void |
setDecimalFormat()
Sets the decimal format to it's standard value |
static void |
setRoundingMode(int roundingMode)
Sets the roundingMode used for bigDecimal |
static void |
setScale(int scale)
Sets the scale used for bigDecimal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static int stcScale
protected static int stcRoundingMode
protected static String stcDefaultBdFormat
protected static DecimalFormat dc
protected static char decimalSeparator
protected static char groupingSeparator
Constructor Detail |
public Tool()
Method Detail |
public static boolean dateValidation(String day, String month, String year)
day
- Day of month (eg. '5', '06', '23', etc).month
- Month of year (eg. '1', '03', etc).year
- Year part of the date (eg. '1972', '2003', etc)public static Date monthYearToDate(String monthYear)
monthYear
- Month of yearpublic static Date getDate(String day, String month, String year)
day
- Day of month (1-31)month
- Month of year (1-12)year
- Year (1971-2xxx)public static int getInt(String str)
str
- String with a number in itpublic static Integer parseInt(String str)
str
- String with a number in itpublic static long getLong(String str)
str
- String with a number in itpublic static double getDouble(String str)
str
- String with a number in itpublic static String getRandomLetters(int numberOfLetters, int seed)
numberOfLetters
- the number of letters to produceseed
- additional seed initializerpublic static String getRandomMixedLetters(int numberOfLetters, int seed)
numberOfLetters
- the number of letters to produceseed
- additional seed initializerpublic static String getRandomDigits(int numberOfDigits)
numberOfDigits
- the number of digits to producepublic static String getRandomDigits(int numberOfDigits, int seed)
numberOfDigits
- the number of digits to produceseed
- the number to seed the random generator withpublic static BigDecimal getBigDecimal(String bdString)
bdString
- string representation of BigDecimal.public static void setDecimalFormat()
public static String bigDecimalToString(BigDecimal bd)
bd
- The BigDecimal that has to be convertedpublic static String formatBigDecimalString(String bdString)
bdString
- String representation of BigDecimal.public static void setBigDecimalFormatPattern(String pattern)
pattern
- Pattern representing the format for the pretty printpublic static void setScale(int scale)
scale
- Scale used for bigDecimalpublic static void setRoundingMode(int roundingMode)
roundingMode
- used for bigDecimalpublic static int getScale()
public static int getRoundingMode()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |