You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
906 B

  1. /*!! Program*/
  2. /*!
  3. Composition
  4. ===========
  5. */
  6. /*!- Header*/
  7. package program;
  8. /*! A `Composition` combines two programs (`first` and `second`) with the intended semantics of sequential
  9. composition. */
  10. public class Composition extends Program {
  11. public final Program first;
  12. public final Program second;
  13. public Composition(Program first, Program second) {
  14. this.first = first;
  15. this.second = second;
  16. }
  17. /*!- String serialization */
  18. @Override
  19. public String toString() {
  20. return first + " ; " + second;
  21. }
  22. /*!- generated equals implementation */
  23. @Override
  24. public boolean equals(Object o) {
  25. if (this == o) return true;
  26. if (o == null || getClass() != o.getClass()) return false;
  27. Composition that = (Composition) o;
  28. if (!first.equals(that.first)) return false;
  29. return second.equals(that.second);
  30. }
  31. }