freemarker.template

Class SimpleDate

Implemented Interfaces:
TemplateDateModel, TemplateModel

public class SimpleDate
extends java.lang.Object
implements TemplateDateModel

A simple implementation of the TemplateDateModel interface. Note that this class is immutable.

This class is thread-safe.

Version:
$Id: SimpleDate.java,v 1.11 2004/03/13 13:05:09 ddekany Exp $
Author:
Attila Szegedi

Fields inherited from interface freemarker.template.TemplateDateModel

DATE, DATETIME, TIME, TYPE_NAMES, UNKNOWN

Fields inherited from interface freemarker.template.TemplateModel

NOTHING

Constructor Summary

SimpleDate(java.sql.Date date)
Creates a new date model wrapping the specified date object and having DATE type.
SimpleDate(java.sql.Time time)
Creates a new date model wrapping the specified time object and having TIME type.
SimpleDate(java.sql.Timestamp datetime)
Creates a new date model wrapping the specified time object and having DATETIME type.
SimpleDate(java.util.Date date, int type)
Creates a new date model wrapping the specified date object and having the specified type.

Method Summary

java.util.Date
getAsDate()
int
getDateType()
String
toString()

Constructor Details

SimpleDate

public SimpleDate(java.sql.Date date)
Creates a new date model wrapping the specified date object and having DATE type.

SimpleDate

public SimpleDate(java.sql.Time time)
Creates a new date model wrapping the specified time object and having TIME type.

SimpleDate

public SimpleDate(java.sql.Timestamp datetime)
Creates a new date model wrapping the specified time object and having DATETIME type.

SimpleDate

public SimpleDate(java.util.Date date,
                  int type)
Creates a new date model wrapping the specified date object and having the specified type.

Method Details

getAsDate

public java.util.Date getAsDate()
Specified by:
getAsDate in interface TemplateDateModel

getDateType

public int getDateType()
Specified by:
getDateType in interface TemplateDateModel

toString

public String toString()