frepple::utils::DateRange Class Reference
This class defines a date-range, i.e. a start-date and end-date pair. More...
#include <utils.h>
Public Member Functions | |
DateRange (const Date &st, const Date &nd) | |
DateRange () | |
DateRange (const DateRange &n) | |
TimePeriod | getDuration () const |
const Date & | getEnd () const |
const Date & | getStart () const |
bool | intersect (const DateRange &dr) const |
operator string () const | |
bool | operator!= (const DateRange &b) const |
void | operator+= (const TimePeriod &l) |
void | operator-= (const TimePeriod &l) |
void | operator= (const DateRange &dr) |
bool | operator== (const DateRange &b) const |
TimePeriod | overlap (const DateRange &dr) const |
void | setEnd (const Date &d) |
void | setStart (const Date &d) |
void | setStartAndEnd (const Date &st, const Date &nd) |
bool | within (const Date &d) const |
Static Public Member Functions | |
static const string & | getSeparator () |
static void | setSeparator (const string &n) |
Detailed Description
This class defines a date-range, i.e. a start-date and end-date pair.
The behavior is such that the start date is considered as included in it, but the end date is excluded from it. In other words, a daterange is a halfopen date interval: [start,end[
The start and end dates are always such that the start date is less than or equal to the end date.
Constructor & Destructor Documentation
frepple::utils::DateRange::DateRange | ( | ) | [inline] |
frepple::utils::DateRange::DateRange | ( | const DateRange & | n | ) | [inline] |
Member Function Documentation
TimePeriod frepple::utils::DateRange::getDuration | ( | ) | const [inline] |
const Date& frepple::utils::DateRange::getEnd | ( | ) | const [inline] |
static const string& frepple::utils::DateRange::getSeparator | ( | ) | [inline, static] |
const Date& frepple::utils::DateRange::getStart | ( | ) | const [inline] |
bool frepple::utils::DateRange::intersect | ( | const DateRange & | dr | ) | const [inline] |
Return true if two date ranges are overlapping.
The start point of the first interval is included in the comparison, whereas the end point isn't. As a result this method is not symmetrical, ie when a.intersect(b) returns true b.intersect(a) is not nessarily true.
frepple::utils::DateRange::operator string | ( | ) | const |
bool frepple::utils::DateRange::operator!= | ( | const DateRange & | b | ) | const [inline] |
void frepple::utils::DateRange::operator+= | ( | const TimePeriod & | l | ) | [inline] |
void frepple::utils::DateRange::operator-= | ( | const TimePeriod & | l | ) | [inline] |
void frepple::utils::DateRange::operator= | ( | const DateRange & | dr | ) | [inline] |
bool frepple::utils::DateRange::operator== | ( | const DateRange & | b | ) | const [inline] |
TimePeriod frepple::utils::DateRange::overlap | ( | const DateRange & | dr | ) | const [inline] |
void frepple::utils::DateRange::setEnd | ( | const Date & | d | ) | [inline] |
static void frepple::utils::DateRange::setSeparator | ( | const string & | n | ) | [inline, static] |
void frepple::utils::DateRange::setStart | ( | const Date & | d | ) | [inline] |
bool frepple::utils::DateRange::within | ( | const Date & | d | ) | const [inline] |
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
