|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.calendar.TimeInDay
public class TimeInDay
represents the time of the day of any given date.
For String representation, it uses the format H:mm.
SimpleDateFormat,
Serialized Form| Field Summary | |
|---|---|
static SimpleDateFormat |
FOMRAT
the format used to convert between TimeInDay and String using 'H:mm' |
| Fields inherited from interface com.antelmann.calendar.Timed |
|---|
COMPARATOR, DATE_EXTRACTOR |
| Constructor Summary | |
|---|---|
TimeInDay()
uses the current time |
|
TimeInDay(Date time)
takes the time of the day from the given time |
|
TimeInDay(long timeInDay)
time in milliseconds from 12:00 am (must be less than 24h) |
|
TimeInDay(String hourString)
uses the format 'H:mm' |
|
TimeInDay(TimeInDay tid)
|
|
| Method Summary | |
|---|---|
boolean |
after(Date time)
|
boolean |
after(TimeInDay time)
|
boolean |
before(Date time)
|
boolean |
before(TimeInDay time)
|
int |
compareTo(TimeInDay time)
|
boolean |
equals(Object obj)
|
Date |
getDate(Date inDay)
returns the date that is calculated by taking the beginning of the given day and adds this TimeInDay's value. |
int |
getMillis()
|
long |
getTime()
returns the millseconds after midnight (always save to cast the return value to int) |
int |
hashCode()
|
static int |
parse(String s)
returns the milliseconds after midnight represented by the given String in hour format |
void |
setTime(Date time)
|
void |
setTime(long timeInDay)
takes time in milliseconds from 12:00 am (must be less than 24h) |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleDateFormat FOMRAT
| Constructor Detail |
|---|
public TimeInDay()
public TimeInDay(Date time)
public TimeInDay(long timeInDay)
public TimeInDay(TimeInDay tid)
public TimeInDay(String hourString)
throws ParseException
ParseException| Method Detail |
|---|
public void setTime(Date time)
public void setTime(long timeInDay)
public Date getDate(Date inDay)
public boolean before(TimeInDay time)
public boolean after(TimeInDay time)
public boolean before(Date time)
public boolean after(Date time)
public int getMillis()
public long getTime()
getTime in interface Timedpublic int compareTo(TimeInDay time)
compareTo in interface Comparable<TimeInDay>
public static int parse(String s)
throws ParseException
ParseExceptionpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||