|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pandora.util.Utils
public class Utils
Helper utility class.
Field Summary | |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
profanityMap
|
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static java.lang.String |
capitalize(java.lang.String text)
Capitalize the first character of the string. |
static java.lang.String |
compress(java.lang.String text,
int size)
Compress the text to be a proper identifier within the size limit. |
static java.util.List<java.lang.String> |
getWords(java.lang.String text)
Tokenize the sentence into its words. |
static boolean |
isProfanity(java.lang.String text)
Check if the text contains any profanity. |
static java.lang.String |
mapProfanity(java.lang.String word)
If the word is profanity, map it to something less offensive. |
static java.util.Calendar |
parseDate(java.lang.String value)
Parse the date of the form, "yyyy-MM-dd HH:mm:ss.S". |
static java.util.Calendar |
parseDate(java.lang.String value,
java.lang.String format)
Parse the date of the format. |
static java.sql.Timestamp |
parseTimestamp(java.lang.String value)
Parse the date of the form, "yyyy-MM-dd HH:mm:ss.N". |
static java.lang.String |
printDate(java.util.Calendar date)
Print the date in the form, "yyyy-MM-dd HH:mm:ss.S". |
static java.lang.String |
printTimestamp(java.sql.Timestamp timestamp)
Print the date in the form, "yyyy-MM-dd HH:mm:ss.N". |
static void |
sleep(int millis)
|
static java.lang.String |
translateProfanity(java.lang.String text)
If the word is profanity, map it to something less offensive. |
static java.lang.String |
truncate(java.lang.String text,
int size)
Truncate the string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Map<java.lang.String,java.lang.String> profanityMap
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static boolean isProfanity(java.lang.String text)
public static java.lang.String mapProfanity(java.lang.String word)
public static java.lang.String translateProfanity(java.lang.String text)
public static java.util.List<java.lang.String> getWords(java.lang.String text)
public static java.util.Calendar parseDate(java.lang.String value) throws java.text.ParseException
java.text.ParseException
public static java.sql.Timestamp parseTimestamp(java.lang.String value) throws java.text.ParseException
java.text.ParseException
public static java.util.Calendar parseDate(java.lang.String value, java.lang.String format) throws java.text.ParseException
java.text.ParseException
public static java.lang.String printDate(java.util.Calendar date)
public static java.lang.String printTimestamp(java.sql.Timestamp timestamp)
public static void sleep(int millis)
public static java.lang.String compress(java.lang.String text, int size)
public static java.lang.String truncate(java.lang.String text, int size)
public static java.lang.String capitalize(java.lang.String text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |