Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1: Observer and Command Patterns [50 marks (a) Create a Java interface for a mutable (changeable) sequence of integers called IntSequence 7 marks It
Question 1: Observer and Command Patterns [50 marks (a) Create a Java interface for a mutable (changeable) sequence of integers called IntSequence 7 marks It should be possible to o Find the current length of the sequence Retrieve any sub-range of the sequence as an array of integers Remove and sub-range of integers from the sequence . Insert an array of integers at any point in the sequence . Add an observer (see the Observer pattern) . Remove an observer (see the Observer pattern) (b) Create an implementation of the IntSequence interface that is observable. (This does c) Create a set of JUnit tests that demonstrate that your class from (b) functions correctly (d) Use the Command pattern to make a class that implements the IntSequence interface not need to be an efficient implementation.) 14 marks] 8 marks but also supports undoing and redoing actions. You should resulse the class from part (b). [14 marks] (e) Create a set of JUnit tests that demonstrate that your class from (d) functions correctly You can reuse the tests from (c), but will also need additional tests to test undo/redo 7 marks Question 1: Observer and Command Patterns [50 marks (a) Create a Java interface for a mutable (changeable) sequence of integers called IntSequence 7 marks It should be possible to o Find the current length of the sequence Retrieve any sub-range of the sequence as an array of integers Remove and sub-range of integers from the sequence . Insert an array of integers at any point in the sequence . Add an observer (see the Observer pattern) . Remove an observer (see the Observer pattern) (b) Create an implementation of the IntSequence interface that is observable. (This does c) Create a set of JUnit tests that demonstrate that your class from (b) functions correctly (d) Use the Command pattern to make a class that implements the IntSequence interface not need to be an efficient implementation.) 14 marks] 8 marks but also supports undoing and redoing actions. You should resulse the class from part (b). [14 marks] (e) Create a set of JUnit tests that demonstrate that your class from (d) functions correctly You can reuse the tests from (c), but will also need additional tests to test undo/redo 7 marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started