public class TimeDatumFormatter extends DatumFormatter
Modifier and Type | Field and Description |
---|---|
static TimeDatumFormatter |
DAY_OF_YEAR
yyyy-JJJ
|
static TimeDatumFormatter |
DAYS
yyyy-MM-dd
|
static TimeDatumFormatter |
DEFAULT
yyyy-MM-dd'T'HH:mm:ss.SSS'Z
|
static TimeDatumFormatter |
DOY_DAYS
yyyy-MM-dd (JJJ)
|
static TimeDatumFormatter |
HOURS
yyyy-MM-dd HH:'00'
|
static TimeDatumFormatter |
MICROSECONDS
HH:mm:ss.SSSSSS
|
static TimeDatumFormatter |
MILLISECONDS
HH:mm:ss.SSS
|
static TimeDatumFormatter |
MINUTES
HH:mm
|
static TimeDatumFormatter |
MONTHS
yyyy-MM
|
static TimeDatumFormatter |
NANOSECONDS
HH:mm:ss.SSSSSSSSS
|
static TimeDatumFormatter |
SECONDS
HH:mm:ss
|
static TimeDatumFormatter |
YEARS
yyyy
|
logger
Constructor and Description |
---|
TimeDatumFormatter(java.lang.String formatString)
Creates a new instance of TimeDatumFormatter
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(Datum datum) |
static TimeDatumFormatter |
formatterForScale(int scale,
DatumRange context)
returns a TimeDatumFormatter suitable for the specified scale and context.
|
static TimeDatumFormatter |
formatterForScale(int scale,
DatumRange context,
boolean useDOY)
returns a TimeDatumFormatter suitable for the specified scale and context.
|
protected java.text.Format |
getFormat() |
static TimeDatumFormatter |
guessFormatter(DatumVector ticks,
DatumRange context)
guess formatted based on the two ticks given
|
protected java.lang.String |
parseTimeFormatString(java.lang.String input)
parse message format strings like yyyy-MM-DD
|
protected java.lang.String |
parseTimeFormatStringPercent(java.lang.String format)
create the message format, based on %Y, %m, %d format specification
of the UNIX date command.
|
java.lang.String |
toString() |
axisFormat, format, grannyFormat, grannyFormat
public static final TimeDatumFormatter DEFAULT
public static final TimeDatumFormatter DAYS
public static final TimeDatumFormatter DAY_OF_YEAR
public static final TimeDatumFormatter DOY_DAYS
public static final TimeDatumFormatter YEARS
public static final TimeDatumFormatter MONTHS
public static final TimeDatumFormatter HOURS
public static final TimeDatumFormatter MINUTES
public static final TimeDatumFormatter SECONDS
public static final TimeDatumFormatter MILLISECONDS
public static final TimeDatumFormatter MICROSECONDS
public static final TimeDatumFormatter NANOSECONDS
public TimeDatumFormatter(java.lang.String formatString) throws java.text.ParseException
formatString
- java.text.ParseException
public static TimeDatumFormatter formatterForScale(int scale, DatumRange context)
scale
- the length we wish to represent, such as TimeUtil.HOURcontext
- the context for the formatter, or null if the formatted string
will be interpreted outside of any context.java.lang.IllegalArgumentException
- if the scale is TimeUtil.NANOS or is not found in TimeUtil.public static TimeDatumFormatter guessFormatter(DatumVector ticks, DatumRange context)
ticks
- values to representcontext
- null or the external context where the data is interpreted.DateTimeDatumFormatter.axisFormat(org.das2.datum.DatumVector, org.das2.datum.DatumRange)
public static TimeDatumFormatter formatterForScale(int scale, DatumRange context, boolean useDOY)
scale
- the length we wish to represent, such as TimeUtil.HOURcontext
- the context for the formatter, or null if the formatted string
will be interpreted outside of any context.useDOY
- if true then use day-of-year rather than separate month and day.java.lang.IllegalArgumentException
- if the scale is TimeUtil.NANOS or is not found in TimeUtil.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String format(Datum datum)
format
in class DatumFormatter
protected java.text.Format getFormat()
protected final java.lang.String parseTimeFormatString(java.lang.String input) throws java.text.ParseException
input
- java.text.ParseException
protected final java.lang.String parseTimeFormatStringPercent(java.lang.String format) throws java.text.ParseException
format
- the format spec, such as %Y%m%dT%H%Mjava.text.ParseException