org.nakedobjects.applib.value
Class DateTime

java.lang.Object
  extended by org.nakedobjects.applib.value.Magnitude
      extended by org.nakedobjects.applib.value.DateTime
All Implemented Interfaces:
Serializable

public class DateTime
extends Magnitude

Value object representing a date and time value.

See Also:
Serialized Form

Constructor Summary
DateTime()
          Create a Time object for storing a timeStamp set to the current time.
DateTime(Date date)
           
DateTime(int year, int month, int day)
           
DateTime(int year, int month, int day, int hour, int minute)
          Create a Date object set to the specified day, month and year.
DateTime(int year, int month, int day, int hour, int minute, int second)
           
 
Method Summary
 DateTime add(int years, int months, int days, int hours, int minutes)
          Add the specified days, years and months to this date value.
 Calendar calendarValue()
           
protected  DateTime createDateTime(Date date)
           
 Date dateValue()
           
 boolean equals(Object obj)
           
 int getDay()
           
 int getHour()
           
 int getMinute()
           
 int getMonth()
           
 int getYear()
           
 boolean isEqualTo(Magnitude timeStamp)
          returns true if the time stamp of this object has the same value as the specified time
 boolean isLessThan(Magnitude timeStamp)
          returns true if the timeStamp of this object is earlier than the specified timeStamp
 long longValue()
           
 String toString()
           
 
Methods inherited from class org.nakedobjects.applib.value.Magnitude
isBetween, isGreaterThan, isGreaterThanOrEqualTo, isLessThanOrEqualTo, max, min
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTime

public DateTime()
Create a Time object for storing a timeStamp set to the current time.


DateTime

public DateTime(Date date)

DateTime

public DateTime(int year,
                int month,
                int day)

DateTime

public DateTime(int year,
                int month,
                int day,
                int hour,
                int minute)
Create a Date object set to the specified day, month and year.


DateTime

public DateTime(int year,
                int month,
                int day,
                int hour,
                int minute,
                int second)
Method Detail

add

public DateTime add(int years,
                    int months,
                    int days,
                    int hours,
                    int minutes)
Add the specified days, years and months to this date value.


calendarValue

public Calendar calendarValue()

createDateTime

protected DateTime createDateTime(Date date)

dateValue

public Date dateValue()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getDay

public int getDay()

getHour

public int getHour()

getMinute

public int getMinute()

getMonth

public int getMonth()

getYear

public int getYear()

isEqualTo

public boolean isEqualTo(Magnitude timeStamp)
returns true if the time stamp of this object has the same value as the specified time

Specified by:
isEqualTo in class Magnitude

isLessThan

public boolean isLessThan(Magnitude timeStamp)
returns true if the timeStamp of this object is earlier than the specified timeStamp

Specified by:
isLessThan in class Magnitude

longValue

public long longValue()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.