activemq-cpp-3.6.0
decaf::util::Date Class Reference

Wrapper class around a time value in milliseconds. More...

#include <src/main/decaf/util/Date.h>

Inheritance diagram for decaf::util::Date:

Public Member Functions

 Date ()
 Default constructor - sets time to the current System time, rounded to the nearest millisecond.
 Date (long long milliseconds)
 Constructs the date with a given time value.
 Date (const Date &source)
 Copy constructor.
Dateoperator= (const Date &value)
 Assigns the value of one Date object to another.
virtual ~Date ()
long long getTime () const
 Gets the underlying time.
void setTime (long long milliseconds)
 Sets the underlying time.
bool after (const Date &when) const
 Determines whether or not this date falls after the specified time.
bool before (const Date &when) const
 Determines whether or not this date falls before the specified time.
std::string toString () const
 Converts this Date object to a String of the form:
virtual int compareTo (const Date &value) const
virtual bool equals (const Date &value) const
virtual bool operator== (const Date &value) const
virtual bool operator< (const Date &value) const
- Public Member Functions inherited from decaf::lang::Comparable< Date >
virtual ~Comparable ()
virtual int compareTo (const Date &value) const =0
 Compares this object with the specified object for order.
virtual bool equals (const Date &value) const =0
virtual bool operator== (const Date &value) const =0
 Compares equality between this object and the one passed.
virtual bool operator< (const Date &value) const =0
 Compares this object to another and returns true if this object is considered to be less than the one passed.

Detailed Description

Wrapper class around a time value in milliseconds.

This class is comparable to Java's java.util.Date class.

Since
1.0

Constructor & Destructor Documentation

decaf::util::Date::Date ( )

Default constructor - sets time to the current System time, rounded to the nearest millisecond.

decaf::util::Date::Date ( long long  milliseconds)

Constructs the date with a given time value.

Parameters
millisecondsThe time in milliseconds;
decaf::util::Date::Date ( const Date source)

Copy constructor.

Parameters
sourceThe Date instance to copy into this one.
virtual decaf::util::Date::~Date ( )
virtual

Member Function Documentation

bool decaf::util::Date::after ( const Date when) const

Determines whether or not this date falls after the specified time.

Parameters
whenThe date to compare
Returns
true if this date falls after when.
bool decaf::util::Date::before ( const Date when) const

Determines whether or not this date falls before the specified time.

Parameters
whenThe date to compare
Returns
true if this date falls before when.
virtual int decaf::util::Date::compareTo ( const Date value) const
virtual
virtual bool decaf::util::Date::equals ( const Date value) const
virtual
long long decaf::util::Date::getTime ( ) const

Gets the underlying time.

Returns
The underlying time value in milliseconds.
virtual bool decaf::util::Date::operator< ( const Date value) const
virtual
Date& decaf::util::Date::operator= ( const Date value)

Assigns the value of one Date object to another.

Parameters
valueThe value to be copied into this Date object.
Returns
reference to this object with the newly assigned value.
virtual bool decaf::util::Date::operator== ( const Date value) const
virtual
void decaf::util::Date::setTime ( long long  milliseconds)

Sets the underlying time.

Parameters
millisecondsThe underlying time value in milliseconds.
std::string decaf::util::Date::toString ( ) const

Converts this Date object to a String of the form:

dow mon dd hh:mm:ss zzz yyyy

where:

  • dow is the day of the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat).
  • mon is the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
  • dd is the day of the month (01 through 31), as two decimal digits.
  • hh is the hour of the day (00 through 23), as two decimal digits.
  • mm is the minute within the hour (00 through 59), as two decimal digits.
  • ss is the second within the minute (00 through 61, as two decimal digits.
  • zzz is the time zone (and may reflect daylight saving time). Standard time zone abbreviations include those recognized by the method parse. If time zone information is not available, then zzz is empty - that is, it consists of no characters at all.
  • yyyy is the year, as four decimal digits.
Returns
the String representation of the Date object.

The documentation for this class was generated from the following file: