Question: Help with this Hello, I need help with this questions: OODP Consider the following generic queue interface interface MyQueue // return the top of the

Help with this

Help with this Hello, I need help with this questions: OODP Consider

Hello, I need help with this questions: OODP Consider the following generic queue interface interface MyQueue // return the top of the queue element or throw NoSuchElementException if empty E head); // remove and return the top of the queue element or throw NoSuchElementException if E dequeue() // add an element to the queue empty void enqueue(E e // returns the size of the queue int size) // returns true if the queue is empty boolean isEm ptyl: // add elements to this queue from a collection c of E references void addAlI(Collection extends E> c); a) Use the Adapter pattern to design a generic queue class called LQueue implements interface MyQueue and that uses a LinkedList object to stores the queue elements. Write the UML class diagram for the pattern ldentify the pattern roles (e.g. "adapter", "adapte) with UML notes on the class diagram. b) Implement class LQe> in Java Write correct contracts for each method. (Notice that NoSuchElementException is not a checked exception, but you could put it in the function signature.) c) Write a classQueueTest with a main(...) method that tests all 6 methods from class LQueue There is no need of junit unit tests. Use hardcoded objects

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!