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(DateType src)
copy constructor
|
DateType(String text,
String format,
String type)
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() |
static 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(String[] args)
test
|
void |
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()
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 static String hiddenProperties()
public Date getDate()
public CalendarDate getCalendarDate()
public boolean isPresent()
public boolean isBlank()
public String getText()
public String getFormat()
public String getType()
public void setType(String type)
type
- type of Datepublic 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)
public static void main(String[] args)
Copyright © 1999–2015 UCAR/Unidata. All rights reserved.