dtintrv.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*******************************************************************************
  4. * Copyright (C) 2008, International Business Machines Corporation and
  5. * others. All Rights Reserved.
  6. *******************************************************************************
  7. *
  8. * File DTINTRV.CPP
  9. *
  10. *******************************************************************************
  11. */
  12. #include "unicode/dtintrv.h"
  13. U_NAMESPACE_BEGIN
  14. UOBJECT_DEFINE_RTTI_IMPLEMENTATION(DateInterval)
  15. //DateInterval::DateInterval(){}
  16. DateInterval::DateInterval(UDate from, UDate to)
  17. : fromDate(from),
  18. toDate(to)
  19. {}
  20. DateInterval::~DateInterval(){}
  21. DateInterval::DateInterval(const DateInterval& other)
  22. : UObject(other) {
  23. *this = other;
  24. }
  25. DateInterval&
  26. DateInterval::operator=(const DateInterval& other) {
  27. if ( this != &other ) {
  28. fromDate = other.fromDate;
  29. toDate = other.toDate;
  30. }
  31. return *this;
  32. }
  33. DateInterval*
  34. DateInterval::clone() const {
  35. return new DateInterval(*this);
  36. }
  37. bool
  38. DateInterval::operator==(const DateInterval& other) const {
  39. return ( fromDate == other.fromDate && toDate == other.toDate );
  40. }
  41. U_NAMESPACE_END