public class GuiUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
MILLIS_PER_DAY
Number of milliseconds in a standard day.
|
static long |
MILLIS_PER_HOUR
Number of milliseconds in a standard hour.
|
static long |
MILLIS_PER_MINUTE
Number of milliseconds in a standard minute.
|
static long |
MILLIS_PER_SECOND
Number of milliseconds in a second.
|
Constructor and Description |
---|
GuiUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
compareDates(java.util.Date date1,
java.util.Date date2)
Compares the two dates.
|
static int |
compareDates(long date1,
long date2)
Compares the two dates.
|
static int |
compareDatesOnly(java.util.Date date1,
java.util.Date date2)
Compares the two dates.
|
static int |
compareDatesOnly(long date1,
long date2)
Compares the two dates.
|
static int |
countOccurrences(java.lang.String text,
char needle)
Counts occurrences of the needle character in the given
text.
|
static java.lang.String |
escapeFileNameSpecialCharacters(java.lang.String string)
Replaces the characters that we must escape used for the created
filename.
|
static java.lang.String |
escapeHTMLChars(java.lang.String message)
Escapes special HTML characters such as <, >, & and " in
the specified message.
|
static java.lang.String |
formatDate(java.util.Date date)
Formats the given date.
|
static void |
formatDate(java.util.Date date,
java.lang.StringBuffer dateStrBuf)
Formats the given date as: Month DD, YYYY and appends it to the given
dateStrBuf string buffer.
|
static java.lang.String |
formatDate(long date)
Formats the given date.
|
static void |
formatDate(long date,
java.lang.StringBuffer dateStrBuf)
Formats the given date as: Month DD, YYYY and appends it to the given
dateStrBuf string buffer.
|
static java.lang.String |
formatSeconds(long millis)
Formats the given long to X hour, Y min, Z sec.
|
static java.lang.String |
formatTime(java.util.Date date)
Formats the time for the given date.
|
static java.lang.String |
formatTime(java.util.Date startDate,
java.util.Date endDate)
Formats the time period duration for the given start date and end date.
|
static java.lang.String |
formatTime(long time)
Formats the time for the given date.
|
static java.lang.String |
formatTime(long start,
long end)
Formats the time period duration for the given start date and end date.
|
static java.lang.String |
replaceSpecialRegExpChars(java.lang.String text)
Replaces some chars that are special in a regular expression.
|
public static final long MILLIS_PER_SECOND
public static final long MILLIS_PER_MINUTE
public static final long MILLIS_PER_HOUR
public static final long MILLIS_PER_DAY
public static java.lang.String replaceSpecialRegExpChars(java.lang.String text)
text
- The initial text.public static int countOccurrences(java.lang.String text, char needle)
text
- the text in which we searchneedle
- the character we're looking forpublic static int compareDates(java.util.Date date1, java.util.Date date2)
date1
- the first date to comparedate2
- the second date to compare withpublic static int compareDates(long date1, long date2)
date1
- the first date to comparedate2
- the second date to compare withpublic static int compareDatesOnly(long date1, long date2)
date1
- the first date to comparedate2
- the second date to compare withpublic static int compareDatesOnly(java.util.Date date1, java.util.Date date2)
date1
- the first date to comparedate2
- the second date to compare withpublic static java.lang.String formatDate(java.util.Date date)
date
- the date to formatpublic static java.lang.String formatDate(long date)
date
- the date to formatpublic static void formatDate(long date, java.lang.StringBuffer dateStrBuf)
date
- the date to formatdateStrBuf
- the StringBuffer, where to append the
formatted datepublic static void formatDate(java.util.Date date, java.lang.StringBuffer dateStrBuf)
date
- the date to formatdateStrBuf
- the StringBuffer, where to append the
formatted datepublic static java.lang.String formatTime(java.util.Date date)
date
- the date to formatpublic static java.lang.String formatTime(long time)
time
- the date to formatpublic static java.lang.String formatTime(java.util.Date startDate, java.util.Date endDate)
startDate
- the start dateendDate
- the end datepublic static java.lang.String formatTime(long start, long end)
start
- the start date in millisecondsend
- the end date in millisecondspublic static java.lang.String formatSeconds(long millis)
millis
- the time in milliseconds to formatpublic static java.lang.String escapeFileNameSpecialCharacters(java.lang.String string)
string
- the String which is to have its characters escapedpublic static java.lang.String escapeHTMLChars(java.lang.String message)
message
- the message to be processed
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.