+----------------------------------+ | ILoCross |<--+ +----------------------------------+ | | | / \ | --- | | | --------------------------- | | | | +----------------+ +-------------------+ | | MtLoCross | | ConsLoCross | | +----------------+ +-------------------+ | +----------------+ +--| Crossword first | | | | ILoCross rest |---+ | +-------------------+ v +---------------+ | Crossword | +---------------+ | String theme | | int across | | int down | | String level | +---------------+
public interface ISelectCrossword { /* Return true if the given Crossword should be selected */ public boolean select(Crossword c); }Create a class that implements ISelectCrossword. The criterion for selection is that the total number of clues in the given Crossword is less than 300. Make sure you provide tests for your class.
allLessThan300
that determines if
all the crosswords in this list have fewer than 300 clues. The method should take
as an argument an instance of the class you created in Problem 2. Test.
anyContainWPI
that determines if any of the
Crosswords in this list have themes with the string "WPI" in them. Test.
allSuchCrosswords
that determines whether all Crosswords in a list satisfy the predicate defined by the given instance of
an ISelectCrossword. Provide test cases for allSuchCrosswords that
determine if all the Crosswords in a list have fewer than 300 clues, and
if all the Crosswords in a list have themes with the string "WPI".
GivenDifficulty
that implements the ISelectCrossword
interface with a method that returns true for all Crosswords that are of a
given level of difficulty. The desired level is provided as a parameter to
the constructor, and so is specified when a new instance of the class
GivenDifficulty
is created. Test.
filter
that produces a list of only those crosswords
that satisfy the given predicate. Write test cases for filter
that
filter lists to produce lists of crosswords
with fewer than 300 clues, lists of crosswords with "WPI" in the theme name,
lists of difficult crosswords, and lists of easy crosswords.
Create an archive of your Eclipse project. Using web-based turnin, turn in a single zip file containing all code and documentation for this assignment. Follow the naming conventions when naming your file.