org.eigenbase.util14
Class ZonelessDate

java.lang.Object
  extended by org.eigenbase.util14.ZonelessDatetime
      extended by org.eigenbase.util14.ZonelessDate
All Implemented Interfaces:
Serializable, BasicDatetime

public class ZonelessDate
extends ZonelessDatetime

ZonelessDate is a date value without a time zone.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/util14/ZonelessDate.java#7 $
Author:
John Pham
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          SerialVersionUID created with JDK 1.5 serialver tool.
protected  Date tempDate
           
 
Fields inherited from class org.eigenbase.util14.ZonelessDatetime
internalTime, lastFormat, tempCal, tempFormatter
 
Constructor Summary
ZonelessDate()
          Constructs a ZonelessDate.
 
Method Summary
protected  Date getTempDate(long value)
          Gets a temporary Date object.
static ZonelessDate parse(String s)
          Parses a string as a ZonelessDate.
static ZonelessDate parse(String s, String format)
          Parses a string as a ZonelessDate with a given format string.
 void setZonedTime(long value, TimeZone zone)
          Sets this datetime via a zoned time value.
 void setZonelessTime(long value)
          Sets this datetime via a zoneless time value.
 Object toJdbcObject()
          Returns this datetime as a Jdbc object
 String toString()
          Converts this ZonelessDate to a java.sql.Date and formats it via the toString() method of that class.
 String toString(String format)
          Formats this ZonelessDate via a SimpleDateFormat
 
Methods inherited from class org.eigenbase.util14.ZonelessDatetime
clearDate, clearTime, getCalendar, getDateValue, getFormatter, getJdbcDate, getJdbcTime, getJdbcTimestamp, getTime, getTimeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
SerialVersionUID created with JDK 1.5 serialver tool.

See Also:
Constant Field Values

tempDate

protected transient Date tempDate
Constructor Detail

ZonelessDate

public ZonelessDate()
Constructs a ZonelessDate.

Method Detail

setZonelessTime

public void setZonelessTime(long value)
Description copied from interface: BasicDatetime
Sets this datetime via a zoneless time value. See class comments for more information.

Specified by:
setZonelessTime in interface BasicDatetime
Overrides:
setZonelessTime in class ZonelessDatetime

setZonedTime

public void setZonedTime(long value,
                         TimeZone zone)
Description copied from interface: BasicDatetime
Sets this datetime via a zoned time value. See class comments for more information.

Specified by:
setZonedTime in interface BasicDatetime
Overrides:
setZonedTime in class ZonelessDatetime

toJdbcObject

public Object toJdbcObject()
Description copied from class: ZonelessDatetime
Returns this datetime as a Jdbc object

Specified by:
toJdbcObject in class ZonelessDatetime

toString

public String toString()
Converts this ZonelessDate to a java.sql.Date and formats it via the toString() method of that class.

Overrides:
toString in class Object
Returns:
the formatted date string

toString

public String toString(String format)
Formats this ZonelessDate via a SimpleDateFormat

Parameters:
format - format string, as required by SimpleDateFormat
Returns:
the formatted date string

parse

public static ZonelessDate parse(String s)
Parses a string as a ZonelessDate.

Parameters:
s - a string representing a date in ISO format, i.e. according to the SimpleDateFormat string "yyyy-MM-dd"
Returns:
the parsed date, or null if parsing failed

parse

public static ZonelessDate parse(String s,
                                 String format)
Parses a string as a ZonelessDate with a given format string.

Parameters:
s - a string representing a date in ISO format, i.e. according to the SimpleDateFormat string "yyyy-MM-dd"
format - format string as per SimpleDateFormat
Returns:
the parsed date, or null if parsing failed

getTempDate

protected Date getTempDate(long value)
Gets a temporary Date object. The same object is returned every time.