activemq-cpp-3.9.5
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

◆ Date() [1/3]

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

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

Referenced by after(), before(), compareTo(), Date(), equals(), operator<(), operator=(), and operator==().

◆ Date() [2/3]

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

Constructs the date with a given time value.

Parameters
millisecondsThe time in milliseconds;

◆ Date() [3/3]

decaf::util::Date::Date ( const Date & source)

Copy constructor.

Parameters
sourceThe Date instance to copy into this one.

References Date().

◆ ~Date()

virtual decaf::util::Date::~Date ( )
virtual

Member Function Documentation

◆ after()

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.

References Date().

◆ before()

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.

References Date().

◆ compareTo()

virtual int decaf::util::Date::compareTo ( const Date & value) const
virtual

References Date().

◆ equals()

virtual bool decaf::util::Date::equals ( const Date & value) const
virtual

References Date().

◆ getTime()

long long decaf::util::Date::getTime ( ) const

Gets the underlying time.

Returns
The underlying time value in milliseconds.

◆ operator<()

virtual bool decaf::util::Date::operator< ( const Date & value) const
virtual

References Date().

◆ operator=()

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.

References Date().

◆ operator==()

virtual bool decaf::util::Date::operator== ( const Date & value) const
virtual

References Date().

◆ setTime()

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

Sets the underlying time.

Parameters
millisecondsThe underlying time value in milliseconds.

◆ toString()

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: