| java.lang.Object java.util.Date org.mmbase.util.DynamicDate
DynamicDate | public class DynamicDate extends Date (Code) | | A DynamicDate is a Date object that has no fixed value, like 'now'. It is unmodifiable, so all
set-methods throw exceptions. There is no public constructor, but a public static
DynamicDate.getInstance .
Sadly, the Date object of Sun is implemented using private static methods which use private
fields, of the Date object so not everything could be overridden perfectly. So, if e.g. a dynamic
date could be an argument of a 'after' or 'before' method, it is better to wrap it with
DynamicDate.eval first.
author: Michiel Meeuwissen since: MMBase-1.8 |
Field Summary | |
final protected String | date The original string by which this instance was gotten. |
date | final protected String date(Code) | | The original string by which this instance was gotten.
|
compareTo | public int compareTo(Date anotherDate)(Code) | | |
eval | public static Date eval(Date date)(Code) | | Makes sure the argument 'date' is no DynamicDate any more. So this returns a fixed date
object when the argument is a DynamicDate and simply the argument if it is not.
|
evalDate | protected Date evalDate()(Code) | | This produces a normal Date object, and is called everytime when that is needed. Users can call it too, if they want to fixated
|
getDate | public int getDate()(Code) | | |
getDay | public int getDay()(Code) | | |
getHours | public int getHours()(Code) | | |
getInstance | public static Date getInstance(String format) throws ParseException(Code) | | Parses a format string and returns Date instance, possibly a 'dynamic one'. Not necessary a new one, which
does not matter, because these objects are unmodifiable anyway.
If the request date is not dynamic, but absolutely defined, a normal Date object is returned.
|
getMinutes | public int getMinutes()(Code) | | |
getMonth | public int getMonth()(Code) | | |
getSeconds | public int getSeconds()(Code) | | |
getTime | public long getTime()(Code) | | |
getTimezoneOffset | public int getTimezoneOffset()(Code) | | |
getYear | public int getYear()(Code) | | |
hashCode | public int hashCode()(Code) | | |
setDate | public void setDate(int date)(Code) | | |
setHours | public void setHours(int hours)(Code) | | |
setMinutes | public void setMinutes(int minutes)(Code) | | |
setMonth | public void setMonth(int month)(Code) | | |
setSeconds | public void setSeconds(int seconds)(Code) | | |
setTime | public void setTime(long time)(Code) | | |
setYear | public void setYear(int year)(Code) | | |
|
|