|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Calendar
java.util.GregorianCalendar
ch.rgw.tools.TimeTool
public class TimeTool
Klasse zur einfachen Datum- und Zeitberarbeitung
Nested Class Summary | |
---|---|
static class |
TimeTool.TimeFormatException
|
Field Summary | |
---|---|
static java.lang.String |
BEGINNING_OF_UNIX_EPOCH
first day that can be set into a TimeTool |
static int |
DATE_COMPACT
Constant indicating a compact date format (yyyyMMdd) |
static int |
DATE_GER
Constant indicating a date in german notation (dd.mm.yy) |
static int |
DATE_ISO
Constant indicating a date format in ISO notation (yyyyy-MM-dd) |
static int |
DATE_MYSQL
Constant indicating a date format in ISO notation (yyyyy-MM-dd) |
static int |
DATE_SIMPLE
Constant indicating a simple date in the preferred format |
static int |
DATETIME_XML
Constant indicating an XML Datetime format (yyyy-MM-ddThh:mm:ss) |
static java.lang.String |
END_OF_UNIX_EPOCH
last date a TimeTool can be set to |
static int |
FULL
Constant indicating a full date in the preferred format |
static int |
FULL_GER
Constant indicating a full date/time format in german notation (dd.MM.yyyyy hh:mm:ss) |
static int |
FULL_ISO
Constant indicating a full date/time format in ISO notation (yyyyy-MM-dd hh:mm:ss) |
static int |
FULL_MYSQL
Constant indicating a full date/time format in ISO notation (yyyyy-MM-dd hh:mm:ss) |
static int |
LARGE_GER
Constant indicating a large date/time format in german notation (dd.MM.yyyyy hh:mm) |
static java.lang.String[] |
Mon
Month names as three-letter-abbreviations |
static java.lang.String[] |
Monate
Month names as full words |
static java.lang.String[] |
month_eng
|
static int |
TIME_COMPACT
Constant indicating a compact time format (hhmm) |
static int |
TIME_FULL
Constant indicating a full time format (hh:mm:ss) |
static int |
TIME_SMALL
Constant indicating a small time format (hh:mm) |
static int |
TIMESTAMP
Constant indicating a timestamp format (yyyyMMddhhmmss) |
static java.lang.String[] |
wdays
Weekdays as abbreviations |
static int |
WEEKDAY
|
static java.lang.String[] |
Wochentage
weekdays as full words |
Fields inherited from class java.util.GregorianCalendar |
---|
AD, BC |
Fields inherited from class java.util.Calendar |
---|
ALL_STYLES, AM, AM_PM, APRIL, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, FRIDAY, HOUR, HOUR_OF_DAY, JANUARY, JULY, JUNE, LONG, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET |
Constructor Summary | |
---|---|
TimeTool()
create a TimeTool set to the current date/time |
|
TimeTool(int t,
int res)
Create a TimeTool set to the given units |
|
TimeTool(long millis)
Create a TimeTool set to the specified milliseconds |
|
TimeTool(java.lang.String pre)
Create a TimeTool set to a date/time as indicated by a String |
|
TimeTool(java.lang.String pre,
boolean bFailIfInvalid)
Create a TimeTool set to a date/time as indicated by a String |
|
TimeTool(TimeTool other)
Create a TimeTool set to another TimeTool's date/time |
Method Summary | |
---|---|
void |
addDays(int d)
|
void |
addHours(int h)
|
void |
addMinutes(int m)
|
void |
addSeconds(int s)
|
void |
addUnits(int m)
|
void |
chop(int w)
Inhalt kürzen. |
int |
compareTo(java.util.Calendar arg0)
|
int |
daysTo(TimeTool o)
Return the number of daysd between (including) this and (excluding) an other TimeTool |
long |
diff(TimeTool o,
long res)
Differenz zu einem anderen TimeTool, ausgedrückt in "resolution"-Einheiten |
java.lang.String |
dump()
|
static int |
getMinutesFromTimeString(java.lang.String in)
Parse a String for time information and return these in minutes |
static int |
getSecondsFromTimeString(java.lang.String in)
Parse a String for time information and return these in seconds |
long |
getTimeAsLong()
|
static int |
getTimeInSeconds()
return the time as seconds |
int |
getTimeInUnits()
|
int |
hashCode()
|
boolean |
isAfter(TimeTool o)
|
boolean |
isAfterOrEqual(TimeTool o)
|
boolean |
isBefore(TimeTool o)
|
boolean |
isBeforeOrEqual(TimeTool o)
|
boolean |
isEqual(TimeTool o)
|
boolean |
isSameDay(TimeTool o)
Checks whether two TimeTool values represent the same day (ignoring the time) |
static int |
minutesStringToInt(java.lang.String in)
|
static int[] |
parseDate(java.lang.String tx)
|
static int[] |
parseTime(java.lang.String tx)
Zerlegt einen Zeitstring in Stunden- Minuten- und Sekundenanteile |
int |
secondsTo(TimeTool o)
|
void |
set(java.util.GregorianCalendar gcal)
|
boolean |
set(java.lang.String orig)
Parsed einen String im Format "datum zeit" oder "datum, zeit" oder "datum" oder "zeit". |
void |
set(TimeTool o)
|
void |
setAsUnits(int d)
|
boolean |
setDate(java.lang.String dat)
Set the date, leave the Time untouched |
void |
setDate(TimeTool o)
Set the date to the value of another TimeTool. |
static void |
setDefaultResolution(int r)
|
static void |
setPreferredFormat(java.lang.String full,
java.lang.String small,
java.lang.String wr)
|
void |
setResolution(long res)
|
void |
setTime(TimeTool o)
Set the time, leave the date untouched |
java.lang.String |
toDBString(boolean full)
|
java.lang.String |
toString()
|
java.lang.String |
toString(int f)
|
static java.lang.String |
Version()
|
Methods inherited from class java.util.GregorianCalendar |
---|
add, clone, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, isLeapYear, roll, roll, setGregorianChange, setTimeZone |
Methods inherited from class java.util.Calendar |
---|
after, before, clear, clear, get, getAvailableLocales, getDisplayName, getDisplayNames, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BEGINNING_OF_UNIX_EPOCH
public static final java.lang.String END_OF_UNIX_EPOCH
public static final java.lang.String[] Monate
public static final java.lang.String[] Mon
public static final java.lang.String[] month_eng
public static final java.lang.String[] wdays
public static final java.lang.String[] Wochentage
public static final int FULL_GER
public static final int LARGE_GER
public static final int TIME_FULL
public static final int TIME_SMALL
public static final int DATE_GER
public static final int FULL_MYSQL
public static final int DATE_MYSQL
public static final int FULL_ISO
public static final int DATE_ISO
public static final int TIME_COMPACT
public static final int DATE_COMPACT
public static final int FULL
public static final int DATE_SIMPLE
public static final int WEEKDAY
public static final int TIMESTAMP
public static final int DATETIME_XML
Constructor Detail |
---|
public TimeTool()
public TimeTool(TimeTool other)
other
- another TimeTool which will not be affectedpublic TimeTool(int t, int res)
t
- number of unitsres
- multiplicator for the units in millisecondspublic TimeTool(java.lang.String pre)
pre
- a date/time String in one of the supported formats. If the String can not be
parsed, the TimeTool will be set to the current date/timepublic TimeTool(java.lang.String pre, boolean bFailIfInvalid) throws TimeTool.TimeFormatException
pre
- a date/time String in one of the supported formats.bFailIfInvalid
- true: Throw an Exception if pre cannot be parsed, false: set to current date/time
TimeTool.TimeFormatException
public TimeTool(long millis)
millis
- Milliseconds after the epoch (same as System.getCirrentTimeMillis()Method Detail |
---|
public static java.lang.String Version()
public static int getTimeInSeconds()
public static int getMinutesFromTimeString(java.lang.String in)
in
- a String formatted in one ofthe supported date/time formats
public static int getSecondsFromTimeString(java.lang.String in)
in
- a String formatted in one ofthe supported date/time formats
public boolean set(java.lang.String orig)
public boolean setDate(java.lang.String dat)
dat
- the new dat
public void setDate(TimeTool o)
o
- source that will be untouchedpublic void setTime(TimeTool o)
o
- a source tTimeTool that will not be changedpublic static int[] parseDate(java.lang.String tx)
public static int[] parseTime(java.lang.String tx)
tx
-
public void set(java.util.GregorianCalendar gcal)
public void set(TimeTool o)
public void setAsUnits(int d)
public int secondsTo(TimeTool o)
public int daysTo(TimeTool o)
o
- the other TimeTool
public void setResolution(long res)
public long diff(TimeTool o, long res)
o
- das andere TimeToolres
- die gewünschte Auflösung (in Millisekunden), oder 0, dann wird die
Standard-resolution dieses TimeTools genommen
public boolean isBeforeOrEqual(TimeTool o)
public boolean isBefore(TimeTool o)
public boolean isAfterOrEqual(TimeTool o)
public boolean isAfter(TimeTool o)
public boolean isEqual(TimeTool o)
public boolean isSameDay(TimeTool o)
o
- the TimeTool to compare with
public int getTimeInUnits()
public long getTimeAsLong()
public void chop(int w)
w
- 0: Millisekunden weg, 1: Sekunden, 2: Minuten, 3: Stundenpublic void addUnits(int m)
public void addDays(int d)
public void addMinutes(int m)
public void addHours(int h)
public void addSeconds(int s)
public static void setDefaultResolution(int r)
public static void setPreferredFormat(java.lang.String full, java.lang.String small, java.lang.String wr)
public java.lang.String toDBString(boolean full)
public java.lang.String toString()
toString
in class java.util.Calendar
public java.lang.String dump()
public java.lang.String toString(int f)
public int hashCode()
hashCode
in class java.util.GregorianCalendar
public static int minutesStringToInt(java.lang.String in)
public int compareTo(java.util.Calendar arg0)
compareTo
in interface java.lang.Comparable<java.util.Calendar>
compareTo
in class java.util.Calendar
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |