Download this zip file and import it into Eclipse as a project https www cs umd edu fpe 132 Lab07 zip You will be implementing the Iterator for a class called StringFilter which implements the Iterable String interface The StringFilter class has two instance variables ArrayList String list int lengthToKeep 1 First for practice implement the class StringFilterIterator so that the iterator goes through and provides via calls to next all of the Strings in the list The variable called lengthToKeep is not being used at this point You must implement all three methods of the Iterator interface next hasNext and remove 2 This is much harder Try to re code your implementation so that your iterator will provide via next only those Strings in the list whose length is equal to the value of lengthToKeep For example if the list is hi there what are you doing today and the lengthToKeep is 3 then the Iterator should provide via next the Strings are you If the lengthToKeep is changed to 5 then the Iterator should provide via next the Strings there doing today You may assume that the value of the variable lengthToKeep will not change while the Iterator is in the midst of iterating over the list 3 Run Driver1 to see if your implementation is working If your remove isn t working be sure to write the iterator in such a way that it doesn t modify the original list and also doesn t copy any portion of the original list to another data structure 4 If you have time try running Driver2 which will display all words of a specified length that are found in the play Romeo and Juliet
View Full Document