public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static BigDecimal |
BILLION |
static BigDecimal |
HUNDRED |
static BigDecimal |
MILLION |
static BigDecimal |
THOUSAND |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
getBigDecimal(String data) |
static BigDecimal |
getBigDecimal(String dataMain,
String dataSub) |
static double |
getDouble(String data) |
static Integer |
getInt(String data) |
static Long |
getLong(String data) |
static BigDecimal |
getPercent(BigDecimal numerator,
BigDecimal denominator) |
static double |
getPercent(double numerator,
double denominator) |
static String |
getString(String data) |
static String |
getURLParameters(Map<String,String> params) |
static String |
join(String[] data,
String d) |
static Calendar |
parseDateTime(String date,
String time,
TimeZone timeZone)
Used to parse the last trade date / time.
|
static Calendar |
parseDividendDate(String date)
Used to parse the dividend dates.
|
static Calendar |
parseHistDate(String date) |
static String |
stripOverhead(String line)
Strips the unwanted chars from a line returned in the CSV
Used for parsing the FX CSV lines
|
static String |
unescape(String data) |
static Calendar |
unixToCalendar(long timestamp) |
public static final BigDecimal HUNDRED
public static final BigDecimal THOUSAND
public static final BigDecimal MILLION
public static final BigDecimal BILLION
public static BigDecimal getBigDecimal(String data)
public static BigDecimal getBigDecimal(String dataMain, String dataSub)
public static double getDouble(String data)
public static BigDecimal getPercent(BigDecimal numerator, BigDecimal denominator)
public static double getPercent(double numerator, double denominator)
public static Calendar parseDividendDate(String date)
date
- String received that represents the datepublic static Calendar parseDateTime(String date, String time, TimeZone timeZone)
date
- String received that represents the datetime
- String received that represents the timetimeZone
- time zone to use for parsing the date timepublic static Calendar unixToCalendar(long timestamp)
public static String stripOverhead(String line)
line
- the original CSV lineCopyright © 2022. All rights reserved.