Project 5 - Java Statistics Revisited

Due Monday, May 14, 2012 - 5:00pm

For Project 5, you will revisit your solution to Project 4.

Part 1 (85/100 points)

For part 1, you will reimplement the basic functionality described in Project 4, only you are required to use the design outlined in the Project 5 Javadoc. There are a few notable changes:

  1. You are required to use a LinkedList that you implement in your solution. The LinkedList will be comprised of Info objects, from which FileInfo, ProjectInfo, and WorkspaceInfo inherit. Hint: the get method of InfoLinkedList will return an Info object, but you may need to cast it to be a more specific type before calling its methods.
  2. You must use inheritance in the implementation of your data structures.
  3. You are advised to begin with the implementation of the Node, InfoLinkedList, Info, and FileInfo classes. Once complete, move on to FileProcessor. Then, implement ProjectInfo and ProjectProcessor. Finally, implement WorkspaceInfo and WorkspaceProcessor, followed by WorkspaceStatsDriver. WorkspaceStatsDriver must take a command line parameter!
  4. The file Tester.java should be used for incremental testing of your assignment. Your grade will primarily depend on the number of tests your code passes.

Part 2 (15/100 points, plus up to 5 points extra credit)

For part 2, you will implement additional features as described below. You may extend the original design by adding classes and data structures, but you must not change it by, for example, deleting methods.

You may earn up to 20 points total for part 2. If you implement part 1 plus the first two features, your score would be 95/100. If you implemented all features, your score would be 105/100 (extra credit).

Feature 1: Block Comments in Middle of Line (5 points) - Modify your FileProcessor class so that it considers block comments that start in the middle of a line but span multiple lines.

int i = 0; //not a comment line

int j = 1; /*start of a block comment, but not a comment line

comment line

another comment line*/

int k = 2; /* not a comment line */

Feature 2: Count of if/while/for/do Statements (5 points) - When printing the statistics in a FileInfo object, print the number of if statements, while loops, for loops, and do loops found in the code.

Feature 3: Class Files Up to Date? (10 points) - When printing statistics for a ProjectInfo object, print a list of the classes that have not been compiled since the last time the java file was modified. To do this, you will need to (recursively!) process the bin directory as well as the src directory. Each java should have an associated .class file in the bin directory. If there is no associated class file, then the class is not up to date. If there is an associated class file, you will need to use the lastModified() method of the java.io.File class to determine when the java file was last modified and when the class file was last modified. If the java file was modified more recently than the class file, then the class is not up to date.

Required: in your top-level project5 directory, please include a README text file. In that file, specify which features you completed, for example "Completed Part 1, Feature 1, Feature 3" or "Completed Part 1, Feature 1, Feature 2".

See your instructor for additional possible extra credit features. All features described above must be completed and approved by the instructor before additional extra credit will be assigned.

Please submit your work in an SVN directory https://www.cs.usfca.edu/svn/<username>/cs112/project5