Jason,
Take a deep breath. Calm down. This is supposed to be a fun and challenging assignment, and we've given you a huge amount of freedom to do things any way that you please. We went through considerable effort to create this new for this class, and so undoubtedly there will be a few rough spots. We've also specified the bare minimum that we think it reasonable, given that we will want to grade about 100 of these things.
Now, to answer your questions:
- You are right that one could possibly do away with hasNext() in WebSpider. However, one nice feature is to be able to "restart" or "continue" the crawling from the previous spot. So, for example, suppose you invoke the spider and it finishes its crawl, up to the limit of, say, 10 pages. You might then want to continue that crawl for another 10 pages, picking up right from where you left off before.
Not a big deal, given how we are likely to grade this, but a realistic option anyway.
- I agree that the Spider.java interface is not really necessary. The idea here was to help you by providing as simple a Java file as possible, to help organize your thoughts on part 2. (Many 15-211 students traditionally have a hard time reading code, so providing the interfaces for Spider.java and Index.java helps convey a lot of information without giving a lot of Java code.)
From your message I can only assume that you are way beyond needing this kind of help, so I suggest that you bear with us while we help the rest of the class by providing these interface files... |