|
Großmarkt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--market.Conversions
A collection of methods to convert Strings, numbers and other Objects into another format.
Constructor Summary | |
Conversions()
|
Method Summary | |
static String |
convertComma(String s)
Converts all commas in a string into points (e.g. 1,225 => 1.225). |
static Calendar |
createToday()
|
static int |
currencyToInt(String s,
boolean euroToCents)
Converts a currency string into an int. |
static CatalogItemImpl |
customerToCI(UCustomer customer)
Creates a CatalogItemImpl from a UCustomer. |
static int |
dayDifference(Calendar cEarly,
Calendar cLate)
Computes the difference between two dates in days. |
static String |
doubleToCurrency(double d)
Converts a double that represents an amount of money in cents into a String. |
static String |
doubleToCurrency(double d,
String extra)
Converts a double that represents an amount of money in cents into a String, that represents the money in Euros (or Dollars...). |
static String |
fixedDecimal(double d,
int decimalPlace)
Converts a double into a String with a fixed number of decimal places. |
static CIArticle |
recordToCIArticle(Object record)
Casts a CIArticle, a CountingStockTableModel.Record or a StockItemImpl into a CIArticle if possible. |
static double |
round(double d,
int decimalPlace)
Cuts a double after the specified number of decimal places. |
static Calendar |
stringToCalendar(String dateString)
Converts a date string ("dd.MM.yyyy") to a Calendar date. |
static String |
valueToCurrency(Value v)
Converts a Value that represents an amount of money in cents into a String, that represents the money in Euros (or Dollars...). |
static String |
valueToCurrency(Value v,
String extra)
Converts a Value that represents an amount of money in cents into a String, that represents the money in Euros (or Dollars...). |
static Double |
valueToDouble(Value v)
Converts a Value to a Double. |
static int |
valueToInt(Value v)
Converts a Value to an int. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Conversions()
Method Detail |
public static String fixedDecimal(double d, int decimalPlace)
d
- the double to be converted.decimalPlace
- the number of decimal places
public static String valueToCurrency(Value v)
v
- the value to be converted.
public static String valueToCurrency(Value v, String extra)
v
- the value to be converted.extra
- an extra String added behind the converted value.
public static String doubleToCurrency(double d)
d
- the double to be converted.
public static String doubleToCurrency(double d, String extra)
d
- the double to be converted.extra
- an extra String added behind the converted double.
public static Double valueToDouble(Value v)
v
- the Value to be converted.
public static int currencyToInt(String s, boolean euroToCents)
s
- the string to be converted.euroToCents
- if true
, the string is interpreted as Euro value and multiplied by
100, otherwise the string is assumed to represent cents already.
public static double round(double d, int decimalPlace)
d
- the double to be rounded.decimalPlace
- the decimal place after which is cut.
public static String convertComma(String s)
s
- the String to be converted.
public static CIArticle recordToCIArticle(Object record)
null
is returned.
record
- the Object to be cast.
public static CatalogItemImpl customerToCI(UCustomer customer)
customer
- the customer to create the CatalogItemImpl from.
public static Calendar stringToCalendar(String dateString)
dateString
- the String representing the date.
public static Calendar createToday()
public static int valueToInt(Value v)
v
- the Value to be converted.
public static int dayDifference(Calendar cEarly, Calendar cLate)
cEarly
- the first date.cLate
- the second date.
|
Großmarkt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |