public class DateType extends Object
Constructor and Description |
---|
DateType()
no argument constructor for beans
|
DateType(boolean isPresent,
Date date)
Constructor using a java.util.Date
|
DateType(CalendarDate date)
Constructor using a java.util.CalendarDate
|
DateType(DateType src)
copy constructor
|
DateType(String text,
String format,
String type)
Constructor.
|
DateType(String text,
String format,
String type,
Calendar cal2)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DateType |
add(TimeDuration d) |
DateType |
add(TimeUnit d) |
boolean |
after(Date d)
Is this date after the given date.
|
boolean |
before(Date d)
Is this date before the given date.
|
boolean |
before(DateType d)
Is this date before the given date.
|
boolean |
equals(Object o) |
CalendarDate |
getCalendarDate()
Get this as a CalendarDate
|
Date |
getDate()
Deprecated.
use getCalendarDate()
|
String |
getFormat()
Get the SimpleDateFormat format for parsing the text.
|
String |
getText()
Get a text representation.
|
String |
getType()
Get the type of Date.
|
int |
hashCode() |
boolean |
isBlank()
Was blank text passed to the constructor.
|
boolean |
isPresent()
Does this represent the present time.
|
DateType |
setType(String type)
Set the type of Date.
|
DateType |
subtract(TimeDuration d) |
DateType |
subtract(TimeUnit d) |
String |
toDateString()
Same as DateFormatter.toDateOnlyString()
|
String |
toDateTimeString()
Same as CalendarDateFormatter.toDateTimeStringISO
|
String |
toDateTimeStringISO()
Get ISO formatted string
|
String |
toString()
String representation
|
public DateType(boolean isPresent, Date date)
isPresent
- if true, this represents the "present time"date
- the given Datepublic DateType(CalendarDate date)
date
- the given CalendarDatepublic DateType()
public DateType(DateType src)
src
- copy from herepublic DateType(String text, String format, String type) throws ParseException
text
- string representationformat
- using java.text.SimpleDateFormat, or nulltype
- type of date, or nullParseException
- if error parsing textpublic DateType(String text, String format, String type, Calendar cal2) throws ParseException
text
- string representationformat
- using java.text.SimpleDateFormat, or nulltype
- type of date, or nullcal2
- ucar.nc2.time.Calendar of date, or nullParseException
- if error parsing textpublic Date getDate()
public CalendarDate getCalendarDate()
public boolean isPresent()
public boolean isBlank()
public String getText()
public String getFormat()
public String getType()
public boolean before(Date d)
d
- test against this datepublic boolean before(DateType d)
d
- test against this datepublic boolean after(Date d)
d
- test against this datepublic String toDateString()
public String toDateTimeString()
public String toDateTimeStringISO()
public String toString()
public DateType add(TimeDuration d)
public DateType subtract(TimeDuration d)