com.timeindexing.time
Class AbstractElapsedFormat

java.lang.Object
  extended bycom.timeindexing.time.AbstractElapsedFormat
All Implemented Interfaces:
TimestampFormatting
Direct Known Subclasses:
MicrosecondElapsedFormat, MillisecondElapsedFormat, NanosecondElapsedFormat, SecondElapsedFormat

public abstract class AbstractElapsedFormat
extends java.lang.Object
implements TimestampFormatting

This abstact class has the base methods for objects that format timestamps as elapsed times.


Field Summary
protected static DateFormatter catchAllformat
           
protected static java.text.NumberFormat daysformat
           
protected static DateFormatter firstDayformat
           
protected static DateFormatter firstHourformat
           
protected static DateFormatter firstYearformat
           
protected  long secsPerDay
           
protected  long secsPerHour
           
protected  long secsPerMinute
           
protected  long secsPerYear
           
protected static java.text.NumberFormat yearsformat
           
 
Constructor Summary
AbstractElapsedFormat()
           
 
Method Summary
abstract  java.lang.String dayFormat(RelativeTimestamp t)
          Format a time for 1 day interval, given a Timestamp.
 java.lang.String format(RelativeTimestamp t)
          Format a RelativeTimestamp.
 java.lang.String format(Timestamp t)
          Format a Timestamp.
abstract  java.lang.String fullFormat(RelativeTimestamp t)
          Format a time for any interval, given a Timestamp.
abstract  java.lang.String hourFormat(RelativeTimestamp t)
          Format a time for 1 hour interval, given a Timestamp.
abstract  java.lang.String secondsFormat(RelativeTimestamp t)
          Format a time using seconds and nanoseconds, given a Timestamp.
abstract  java.lang.String yearFormat(RelativeTimestamp t)
          Format a time for 1 year interval, given a Timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstHourformat

protected static DateFormatter firstHourformat

firstDayformat

protected static DateFormatter firstDayformat

daysformat

protected static java.text.NumberFormat daysformat

firstYearformat

protected static DateFormatter firstYearformat

yearsformat

protected static java.text.NumberFormat yearsformat

catchAllformat

protected static DateFormatter catchAllformat

secsPerMinute

protected final long secsPerMinute
See Also:
Constant Field Values

secsPerHour

protected final long secsPerHour
See Also:
Constant Field Values

secsPerDay

protected final long secsPerDay
See Also:
Constant Field Values

secsPerYear

protected final long secsPerYear
See Also:
Constant Field Values
Constructor Detail

AbstractElapsedFormat

public AbstractElapsedFormat()
Method Detail

format

public java.lang.String format(Timestamp t)
Format a Timestamp.

Specified by:
format in interface TimestampFormatting

format

public java.lang.String format(RelativeTimestamp t)
Format a RelativeTimestamp.


secondsFormat

public abstract java.lang.String secondsFormat(RelativeTimestamp t)
Format a time using seconds and nanoseconds, given a Timestamp.


hourFormat

public abstract java.lang.String hourFormat(RelativeTimestamp t)
Format a time for 1 hour interval, given a Timestamp.


dayFormat

public abstract java.lang.String dayFormat(RelativeTimestamp t)
Format a time for 1 day interval, given a Timestamp.


yearFormat

public abstract java.lang.String yearFormat(RelativeTimestamp t)
Format a time for 1 year interval, given a Timestamp.


fullFormat

public abstract java.lang.String fullFormat(RelativeTimestamp t)
Format a time for any interval, given a Timestamp.