interval.h 866 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef INTERVAL_H
  2. #define INTERVAL_H
  3. #include <QString>
  4. /**
  5. * Class representing intervals
  6. * of real numbers.
  7. */
  8. class Interval
  9. {
  10. public:
  11. /**
  12. * Constructor.
  13. * @param min lowest value of the interval
  14. * @param max highest value of the interval
  15. * @param label name of the interval
  16. */
  17. Interval(double min, double max, QString label);
  18. /**
  19. * Check if value is in the interval.
  20. * @param value
  21. * @return true/false
  22. */
  23. bool in(double value) const;
  24. /**
  25. * Getter for label.
  26. * @return label
  27. */
  28. QString getLabel() const;
  29. /**
  30. * @brief Getter for min.
  31. * @return min
  32. */
  33. double getMin() const;
  34. /**
  35. * Getter for max
  36. * @return max
  37. */
  38. double getMax() const;
  39. private:
  40. double _min;
  41. double _max;
  42. QString _label;
  43. };
  44. #endif // INTERVAL_H