Java Utililty Methods Month

List of utility methods to do Month

Description

The list of methods to do Month are organized into topic(s).

Method

StringResolveMonth(String MonthToResolve)
Resolve Month
if (MonthToResolve.equals("Jan"))
    return "01";
if (MonthToResolve.equals("Feb"))
    return "02";
if (MonthToResolve.equals("Mar"))
    return "03";
if (MonthToResolve.equals("Apr"))
    return "04";
...
intreturnMonth(String month)
return Month
if (month.toLowerCase().equals("jan")) {
    return 0;
if (month.toLowerCase().equals("feb")) {
    return 1;
if (month.toLowerCase().equals("mar")) {
    return 2;
...
introundMonthUnits(final int defaultUnitValue)
Round number of units to a 'month suitable' format.
float unit = defaultUnitValue;
while (unit > 144) {
    unit /= 12;
unit = 
        unit >= 12 ? 12 : 
                unit >= 6 ? 6 : 
                        unit >= 4 ? 4 : 
...
voidsetStatis_month(String year_month)
set Statimonth
statis_month = year_month.substring(year_month.length() - 2);
ThreadstartDaemonThread(Runnable runnable)
start Daemon Thread
Thread result = new Thread(runnable);
result.setDaemon(true);
result.start();
return result;
intstringToMonth(String m)
string To Month
if (m.compareTo("Jan") == 0)
    return 1;
if (m.compareTo("Feb") == 0)
    return 2;
if (m.compareTo("Mar") == 0)
    return 3;
if (m.compareTo("Apr") == 0)
    return 4;
...
StringtoAnotherMonthColor(String value, String type)
to Another Month Color
if (type.equals(WEB_VIEW))
    return "<td class=\"anotherMonthColor\">" + value + "</td>";
else if (type.equals(CONSOLE_VIEW))
    return ANSI_YELLOW + value + ANSI_RESET;
else
    return value;
inttoCalendarMonth(int month)
to Calendar Month
return month - 1;
inttoMonths(int years, int months)
to Months
return years * yearsToMonths + months;
voidvalidateMonth(int month)
validate Month
if (month < 1 || month > 12) {
    throw new IllegalArgumentException("Invalid month (must be >= 1 and <= 12.");