Question: UML diagram, array list.(PLEASE INCLUDE A DEMO CLASSSSS! THANK YOU) Implement the following UML diagram (remember that shading + italics here indicates an abstract class)

UML diagram, array list.(PLEASE INCLUDE A DEMO CLASSSSS! THANK YOU)UML diagram, array list.(PLEASE INCLUDE A DEMO CLASSSSS! THANK YOU) Implement the

Implement the following UML diagram (remember that shading + italics here indicates an abstract class) The basic idea here is to create a kind of "wrapper" class that will store an alphabetized list of words. Internally, the words are stored in an ArrayList The abstract class WordList defines several of the basic methods: the getList method should use a shallow copy to return the internal list the setLst method should use a deep copy the compare method will be used for comparing two Wordlist objects The class AlpbabetizedList represents a list of words that has been sorted in alphabetical order (assume for this exercise that all words will be given using lower-case only). The underlying ArrayList for an AlphabetizedList should be in alphabetical order before it is used: this is an invariant. This class defines the following methods: there are two constructors, both of which should use calls to the super-class, the constructor with a single parameter should use a deep copy. After initialization, the internal list of words (if any) should be in alphabetical order the implemented compare method should always look at the first word in both WordLists, and return true if the first word for this AlphabetizedList comes (alphabetically) before the first word in the WordList parameter. So for instance, if list1 = ["apple", "pear", "plum"] list2 = ["aardvark", "llama", "koala"] list3 = ["zebra", "dog", "aardvark"] are the underlying ArrayLists for two WordList objects, then list1.compare (list2): should return false, since "apple" comes after "aardvark", but list2.compare (list 3): should return true, since "aardvark" comes before "zebra". the alphabetize method actually ensures the underlying ArrayList is correctly ordered: after this method is run, the list of words is in alphabetical order. The order of two identical words does not matter. the merge method adds the elements of the passed parameter AlphabetizedList into the current AlphabetizedList Include a small demo class that creates two new AlphabetizedList objects, populates them with words of your choosing (at least five in each), and merges them into a single AlphabetizedList. Use only lower-case letters in your input. Print the results after each AlphabetizedList is created as well as after the merge

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!