|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.raj.extensions.Utils
Useful static utility functions. These are:
stripQuotes(String) )getMonth(int) )#daysInMonth(int,int) )prln(String) )
| Constructor Summary | |
Utils()
|
|
| Method Summary | |
static int |
daysInMonths(int month,
int year)
returns the number of days in the given month, taking account of leapyears |
static java.lang.String |
getDayName(int day)
returns the name of the day corresponding to the given number, starting from 0. |
static java.lang.String |
getMonth(int month)
returns the name of the month corresponding to the given number starting from 0: 0 == January, 1 == February, and so on |
static void |
prln()
prints a blank line |
static void |
prln(java.lang.String str)
print the string str to standard output |
static java.lang.String |
stripQuotes(java.lang.String input)
this method strips all quotes (single (ASCII 39) and double (ASCII 34)) out of the string input and replaces them with
ASCII codes 254 and 255 respectively.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Utils()
| Method Detail |
public static java.lang.String stripQuotes(java.lang.String input)
input and replaces them with
ASCII codes 254 and 255 respectively.
The process goes both ways, so it will decode any strings passed to it as well. Why? Well it's useful in something like an SQL query where you may be passing variables as parameters that may have quotes which mess up the SQL interpreter.
input - The string to have quotes stripped out of it
public static java.lang.String getMonth(int month)
month - an int between 0 and 11
public static java.lang.String getDayName(int day)
day - an int between 0 and 6 representing the day of week
public static int daysInMonths(int month,
int year)
month - the month which you want to get days foryear - the year in which this month is (needed for leapyear calcuations)
public static void prln(java.lang.String str)
str to standard output
str - the String object to be printedpublic static void prln()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||