net.fortuna.ical4j.model
Class DateTime

java.lang.Object
  extended by java.util.Date
      extended by net.fortuna.ical4j.model.Iso8601
          extended by net.fortuna.ical4j.model.Date
              extended by net.fortuna.ical4j.model.DateTime
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public class DateTime
extends Date

Represents a time of day on a specific date.

Author:
Ben Fortuna
See Also:
Serialized Form

Constructor Summary
DateTime()
          Default constructor.
DateTime(boolean utc)
           
DateTime(Date date)
           
DateTime(long time)
           
DateTime(String value)
          Constructs a new DateTime instance from parsing the specified string representation in the default (local) timezone.
DateTime(String value, TimeZone timezone)
          Creates a new date-time instance from the specified value in the given timezone.
 
Method Summary
 boolean equals(Object arg0)
          Uses ObjectUtils to test equality.
 TimeZone getTimeZone()
          Returns the current timezone associated with this date-time value.
 int hashCode()
          Uses HashCodeBuilder to build hashcode.
 boolean isUtc()
           
 void setTime(long time)
           
 void setTimeZone(TimeZone timezone)
          Sets the timezone associated with this date-time instance.
 void setUtc(boolean utc)
          Updates this date-time to display in UTC time if the argument is true.
 String toString()
           
 
Methods inherited from class net.fortuna.ical4j.model.Iso8601
getFormat
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTime

public DateTime()
Default constructor.


DateTime

public DateTime(boolean utc)
Parameters:
utc -

DateTime

public DateTime(long time)
Parameters:
time -

DateTime

public DateTime(Date date)
Parameters:
date -

DateTime

public DateTime(String value)
         throws ParseException
Constructs a new DateTime instance from parsing the specified string representation in the default (local) timezone.

Parameters:
value -
Throws:
ParseException

DateTime

public DateTime(String value,
                TimeZone timezone)
         throws ParseException
Creates a new date-time instance from the specified value in the given timezone. If a timezone is not specified, the default timezone (as returned by TimeZone.getDefault()) is used.

Parameters:
value -
Throws:
ParseException
Method Detail

setTime

public final void setTime(long time)
Overrides:
setTime in class Iso8601

isUtc

public final boolean isUtc()
Returns:
Returns the utc.

setUtc

public final void setUtc(boolean utc)
Updates this date-time to display in UTC time if the argument is true. Otherwise, resets to the default timezone.

Parameters:
utc - The utc to set.

setTimeZone

public final void setTimeZone(TimeZone timezone)
Sets the timezone associated with this date-time instance. If the specified timezone is null

Parameters:
timezone -

getTimeZone

public final TimeZone getTimeZone()
Returns the current timezone associated with this date-time value.

Returns:
a Java timezone

toString

public final String toString()
Overrides:
toString in class Iso8601

equals

public boolean equals(Object arg0)
Uses ObjectUtils to test equality.

Overrides:
equals in class Date

hashCode

public int hashCode()
Uses HashCodeBuilder to build hashcode.

Overrides:
hashCode in class Date


Copyright © 2004-2007 Modularity. All Rights Reserved.