Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

36 рядки
778 B

  1. /*!! Expression */
  2. /*!
  3. Int_(eger)_
  4. ===========
  5. In order to avoid confusion with Java's `Integer` auto-boxing class for the primitive `int` this wrapper is called
  6. `Int` instead of `Integer`.
  7. */
  8. /*!- Header */
  9. package expression;
  10. /*!
  11. An `Int` consists only of its `value`. This class is only needed as a wrapper which allows
  12. us to use an integer as an expression.
  13. */
  14. public class Int extends Expression {
  15. public final int value;
  16. public Int(int value) {
  17. this.value = value;
  18. }
  19. /*!- generated equals implementation */
  20. @Override
  21. public boolean equals(Object o) {
  22. if (this == o) return true;
  23. if (o == null || getClass() != o.getClass()) return false;
  24. Int integer = (Int) o;
  25. return value == integer.value;
  26. }
  27. }