|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.units.DateType
public class DateType
Implements the thredds "dateType" and "dateTypeFormatted" XML element types. This is mostly a general way to specify dates in a string. It allows a date to mean "present". "Present" always sorts after any date, including dates in the future. It allows an optional attribute called "type" which is an enumeration like "created", "modified", etc taken from Dublin Core vocabulary.
A DateType can be specified in the following ways:
Constructor Summary | |
---|---|
DateType()
no argument constructor for beans |
|
DateType(boolean isPresent,
java.util.Date date)
Constructor using a java.util.Date |
|
DateType(DateType src)
copy constructor |
|
DateType(java.lang.String text,
java.lang.String format,
java.lang.String type)
Constructor. |
Method Summary | |
---|---|
DateType |
add(TimeDuration d)
|
DateType |
add(TimeUnit d)
|
boolean |
after(java.util.Date d)
Is this date after the given date. |
boolean |
before(java.util.Date d)
Is this date before the given date. |
boolean |
before(DateType d)
Is this date before the given date. |
boolean |
equals(java.lang.Object o)
|
java.util.Date |
getDate()
Get this as a Date |
java.lang.String |
getFormat()
Get the SimpleDateFormat format for parsing the text. |
java.lang.String |
getText()
Get a text representation. |
java.lang.String |
getType()
Get the type of Date. |
int |
hashCode()
|
static java.lang.String |
hiddenProperties()
For bean editing, public by accident. |
boolean |
isBlank()
Was blank text passed to the constructor. |
boolean |
isPresent()
Does this represent the present time. |
static void |
main(java.lang.String[] args)
test |
void |
setDate(java.util.Date date)
Set the Date. |
void |
setType(java.lang.String type)
Set the type of Date. |
DateType |
subtract(TimeDuration d)
|
DateType |
subtract(TimeUnit d)
|
java.lang.String |
toDateString()
Same as DateFormatter.toDateOnlyString() |
java.lang.String |
toDateTimeString()
Same as DateFormatter.toDateTimeString() |
java.lang.String |
toDateTimeStringISO()
Same as DateFormatter.toDateTimeStringISO() |
java.lang.String |
toString()
String representation |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DateType(boolean isPresent, java.util.Date date)
isPresent
- if true, this represents the "present time"date
- the given datepublic DateType()
public DateType(DateType src)
src
- copy from herepublic DateType(java.lang.String text, java.lang.String format, java.lang.String type) throws java.text.ParseException
text
- string representationformat
- using java.text.SimpleDateFormat, or nulltype
- type of date, or null
java.text.ParseException
- if error parsing textMethod Detail |
---|
public static java.lang.String hiddenProperties()
public java.util.Date getDate()
public void setDate(java.util.Date date)
date
- set to this Datepublic boolean isPresent()
public boolean isBlank()
public java.lang.String getText()
public java.lang.String getFormat()
public java.lang.String getType()
public void setType(java.lang.String type)
type
- type of Datepublic boolean before(java.util.Date d)
d
- test against this date
public boolean before(DateType d)
d
- test against this date
public boolean after(java.util.Date d)
d
- test against this date
public java.lang.String toDateString()
public java.lang.String toDateTimeString()
public java.lang.String toDateTimeStringISO()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public DateType add(TimeDuration d)
public DateType add(TimeUnit d)
public DateType subtract(TimeDuration d)
public DateType subtract(TimeUnit d)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |