Many many thanks to Dr. Garrison for this project description and starting code. THANK YOU BASED BILLIAM
Imagine that you are starting a streaming radio business. Partnerships have been established to provide you with audio content, and you will stream that content to users. You plan to use your knowledge of what songs your users like/dislike to make effective suggestions for new songs that they will like.
In this assignment, you will be designing an abstract data type (ADT) that stores the service’s music library and users’ ratings of songs. This ADT represents a data structure that will be used by both client applications and for administrative uses (like adding new songs to the library).
Once you complete this ADT, you could provide it to the programmers of the client applications, and they will be able to develop applications based on this specification - like you did in project 1.
You could also distribute the ADT to the engineers in charge of implementing the functionality of the data structure. Then these two groups can work in parallel on their respective components, which can work together since they both follow the “contract” that your ADT provides.
You will not be implementing this data structure.
You do not need to consider implementation-level details, since you are only writing the ADT. This means that you must specify the full set of details that a client needs to know in order to use the data structure, but not the details of how the operations will be carried out or how the data will be organized in memory. The implementation details should be left up to the implementers.
Download and extract these materials. Contained are:
StreamingRadiointerface, the file you will modify.
Stationare interfaces you can use for your your methods’ parameters and return types.
- You do not need to implement these! They’re just there for that reason.
- You do not need to assume any of their methods or add methods. Just use their names.
doc/is a directory containing the Javadoc output.
index.htmlto view the docs.
You must write an abstract data type as a Java interface.
We have given you the names of several abstract methods that the data structure would need to support. You must specify them in the Javadoc comments above each method.
You should consider all possible corner cases in your specification, and describe what the class should do in all cases. A client that reads your ADT should know all the things that could go wrong, and how each will be handled.
Error cases should be unambigous to the client, and they should always know which specific error was encountered. For some corner cases, you will need to make a design decision regarding the best way to handle them. You have the freedom to make these decisions any way you wish, as long as you are consistent, thorough, and clear in your descriptions.
Remember that you document parameters by using the
@param name command; return values with
@return, and exceptions with
There are 8 methods. 1 has been done for you, as an example of the kind of specification we are looking for. So you must do the remaining 7. You will be adding parameters, return types, and exceptions to throw to each. Each one has a short description in
StreamingRadio.java, so read those.
- we’ve specified this one for you.
- you can change its specification, if you need to make it work better with your other methods.
- You can assume that the set of users and the set of radio stations are fixed.
- That way, you do not need to include operations to change these collections.
- When coming up with exceptions, you can use the standard Java exceptions where they make sense.
- If none of them fit, you are free to create your own exception classes.
- Follow the template of the exception classes we gave in projects 1 and 3.
- Remember, you are specifying the interface to the client.
- The implementors will use this interface, but they will come up with their own implementation.
Well, you’re not writing any code, but you are writing documentation, and your interface should compile with
javac. You won’t be able to run it, of course ;)
Use this command to produce the HTML documentation:
javadoc -html5 -d doc *.java
If your documentation parses fine, it will produce a file in
index.html which you can open to view it.
If you are using a version of Java older than 1.9, upgrade. If you can’t, use this command:
javadoc -d doc *.java
- : Submission
- Incorrectly submitted projects will lose all 5 points.
- Please follow the submission directions carefully. There’s no reason not to.
- It’s 5 free points, people.
- : compiles with
- : produces documentation with
You will submit a ZIP file named
username is your Pitt username.
Do not put a folder in the zip file, just the following file(s):
- All the java files
- DO NOT include the doc/ directory
Do not submit any IDE project files.
Submit to the Box folder at this link. Drag your zip file into your browser to upload. If you can see your file, you uploaded it correctly!
You can also re-upload if you made a mistake and need to fix it.