|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.text.Format
ucar.unidata.util.TimestampFormat
public class TimestampFormat
TODO: serious synchronization issues
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.text.Format |
|---|
Format.Field |
| Field Summary | |
|---|---|
static String |
isoTimeFmtPattern
SimpleDateFormat pattern to describe ISO 8601 complete date plus hours, minutes, seconds and a decimal fraction of a second. |
| Constructor Summary | |
|---|---|
TimestampFormat()
_more_ |
|
TimestampFormat(DateFormat delegate)
_more_ |
|
TimestampFormat(DateFormat delegate,
Calendar cal)
_more_ |
|
| Method Summary | |
|---|---|
static Timestamp |
computeTimestamp(String ddhhmm,
Timestamp ref)
Given a time string and a time reference, compute the time the string represents. |
static int |
domOff(int dom,
Calendar ref)
Return the number of days to add() to ref DAY_OF_MONTH to get ref DAY_OF_MONTH = dom, such that the time in ref changes the least. |
StringBuffer |
format(Object ts,
StringBuffer buf,
FieldPosition pos)
_more_ |
StringBuffer |
format(Timestamp ts,
StringBuffer buf,
FieldPosition fp)
Formats an Timestamp to produce a string. |
DateFormat |
getDelegate()
_more_ |
static String |
isoformat(Timestamp ts)
_more_ |
static StringBuffer |
isoformat(Timestamp ts,
StringBuffer buf,
FieldPosition fp)
Formats an Timestamp to produce a string. |
static void |
main(String[] args)
_more_ |
Timestamp |
parse(String source)
_more_ |
Timestamp |
parse(String source,
ParsePosition status)
Parses a string to produce a Timestamp. |
Object |
parseObject(String source,
ParsePosition status)
_more_ |
void |
setDelegate(DateFormat delegate)
_more_ |
static void |
tdomOff(String[] args)
_more_ |
static void |
test0(String[] args)
_more_ |
static void |
testHodOff(String[] args)
_more_ |
| Methods inherited from class java.text.Format |
|---|
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String isoTimeFmtPattern
SimpleDateFormat,
Constant Field Values| Constructor Detail |
|---|
public TimestampFormat()
public TimestampFormat(DateFormat delegate)
delegate -
public TimestampFormat(DateFormat delegate,
Calendar cal)
delegate - cal - | Method Detail |
|---|
public static StringBuffer isoformat(Timestamp ts,
StringBuffer buf,
FieldPosition fp)
ts - Timestamp to formatbuf - StringBuffer where the text is to be appendedfp - On input: an alignment field, if desired.
On output: the offsets of the alignment field.
public static String isoformat(Timestamp ts)
ts -
public static int domOff(int dom,
Calendar ref)
dom - int day of month, 1-31ref - Calendar containing the reference time.
exclusive access to ref should be guaranteed by the caller.
public static Timestamp computeTimestamp(String ddhhmm,
Timestamp ref)
throws ParseException
ddhhmm - String timestamp of the form [DD]HHMM
where
DD is 2 digits day of month (01-31) (may be missing)
HH is 2 digits hour of day (00-23)
MM is 2 digits minute of hour (00-59)ref - Timestamp of some moment near to
and generally after the time represented by ddhhmm
ParseExceptionpublic void setDelegate(DateFormat delegate)
delegate - public DateFormat getDelegate()
public StringBuffer format(Timestamp ts,
StringBuffer buf,
FieldPosition fp)
ts - Timestamp to formatbuf - StringBuffer where the text is to be appendedfp - On input: an alignment field, if desired.
On output: the offsets of the alignment field.
public StringBuffer format(Object ts,
StringBuffer buf,
FieldPosition pos)
format in class Formatts - buf - pos -
public Timestamp parse(String source,
ParsePosition status)
source - String to parsestatus - Input-Output parameter.
Before calling, set status.index to the offset you want to start parsing at in the source. After calling, status.index is the end of the text you parsed. If error occurs, index is unchanged.
When parsing, leading whitespace is discarded (with successful parse), while trailing whitespace is left as is.
public Timestamp parse(String source)
throws ParseException
source -
ParseException
public Object parseObject(String source,
ParsePosition status)
parseObject in class Formatsource - status -
public static void test0(String[] args)
args - public static void tdomOff(String[] args)
args - public static void testHodOff(String[] args)
args - public static void main(String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||