DOC PREVIEW
Stanford CS 106A - The Face Pamphlet Repository

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Eric Roberts Handout #51CS 106A February 22, 2010Assignment #5—The FacePamphlet RepositoryAs you write the FacePamphlet application, you will need to make extensive use of theFPRepository class, which manages the client side of the repository. As part of theassignment, we want you to learn about this class by reading its documentation, which isavailable on the assignments area of the course web site. To get you started, however,we’ve given you the method summary as Figure 1.In many ways, the FacePamphlet repository acts like a giant HashMap that allows you tolook up keys for users on a central, permanent database. The keys for the map are aformed by writing the user id of the owner and the name of the key separated by a dot.For example, to look up my full name, for example, you need to use the keyeroberts.nameFigure 1. Javadoc method summary of the FPRepository class– 2 –although you wouldn’t ordinarily write it explicitly. The ids are usually stored invariables, and the names of the keys are defined as constants in the FPConstantsinterface. Thus, if the name of the user whose profile is being visited is stored in thevariable visitId, you could look up this property by making the following call:String name = repository.getProperty(visitId + "." + NAME_KEY);If the period is missing from a key, the server assumes that it refers to the active user.Thus, you could change your password to secret by callingrepository.setProperty(PASSWORD_KEY, "secret");All values in the repository map are strings, which means that non-string values need tobe converted to strings in order to store them there. The most important type you need torepresent in this way is the GImage type. Fortunately, the FPRepository class exportsmethods for converting a GImage to a string and back again, so all you need to do is readthe documentation to figure out what methods you need and how to apply


View Full Document

Stanford CS 106A - The Face Pamphlet Repository

Download The Face Pamphlet Repository
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view The Face Pamphlet Repository and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view The Face Pamphlet Repository 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?