de.fh_mannheim.mm.dms.framework
Class FormattedDate

java.lang.Object
  extended byjava.util.Date
      extended byde.fh_mannheim.mm.dms.framework.FormattedDate
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, IElement, java.io.Serializable

public class FormattedDate
extends java.util.Date
implements IElement

This class is extends the Date-class for better date-handling. With the public declaration of DATE_OFFSET, the date could be set to zero by removing the timezone.

Version:
$Revision: 1.5 $
Author:
Jan Löffler, mail@jlsoft.de
See Also:
Serialized Form

Field Summary
static long DATE_OFFSET
          Dateoffset is used to remove timezone
static long DAY
           
static long HOUR
           
static long MILLISECOND
          Public declarations of time intervals
static long MINUTE
           
static long MONTH
           
static long SECOND
           
static long WEEK
           
static long YEAR
           
 
Constructor Summary
FormattedDate()
          Constructor.
FormattedDate(java.util.Date date)
          Constructor.
FormattedDate(long nMs)
          Constructor.
 
Method Summary
static FormattedDate getNextDay()
          Return the current day.
 java.sql.Date getSQLDate()
          Convert to sqldate object.
 java.lang.String toDateString()
          Date as string
 org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
          Write information of date in a xml element.
 org.w3c.dom.Element toElement(org.w3c.dom.Element element, org.w3c.dom.Document doc)
          Write information of date in a xml element.
 java.lang.String toFormattedString(java.lang.String strType)
          Date as formatted string
 java.lang.String toString()
          Date as string
 java.lang.String toTimeString()
          Time as string
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MILLISECOND

public static final long MILLISECOND
Public declarations of time intervals

See Also:
Constant Field Values

SECOND

public static final long SECOND
See Also:
Constant Field Values

MINUTE

public static final long MINUTE
See Also:
Constant Field Values

HOUR

public static final long HOUR
See Also:
Constant Field Values

DAY

public static final long DAY
See Also:
Constant Field Values

WEEK

public static final long WEEK
See Also:
Constant Field Values

MONTH

public static final long MONTH
See Also:
Constant Field Values

YEAR

public static final long YEAR
See Also:
Constant Field Values

DATE_OFFSET

public static final long DATE_OFFSET
Dateoffset is used to remove timezone

See Also:
Constant Field Values
Constructor Detail

FormattedDate

public FormattedDate()
Constructor.


FormattedDate

public FormattedDate(java.util.Date date)
Constructor.

Parameters:
date - Date

FormattedDate

public FormattedDate(long nMs)
Constructor.

Parameters:
nMs - Time as long format
Method Detail

getNextDay

public static FormattedDate getNextDay()
Return the current day.

Returns:
date

getSQLDate

public java.sql.Date getSQLDate()
Convert to sqldate object.

Returns:
sql date

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
Write information of date in a xml element.

Specified by:
toElement in interface IElement
Parameters:
doc - XML Document
Returns:
element

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Element element,
                                     org.w3c.dom.Document doc)
Write information of date in a xml element.

Specified by:
toElement in interface IElement
Parameters:
element - Root element
doc - XML Document
Returns:
element

toDateString

public java.lang.String toDateString()
Date as string

Returns:
date text

toFormattedString

public java.lang.String toFormattedString(java.lang.String strType)
Date as formatted string

Returns:
date text

toTimeString

public java.lang.String toTimeString()
Time as string

Returns:
time text

toString

public java.lang.String toString()
Date as string

Specified by:
toString in interface IElement
Returns:
date text