-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScribe.java
More file actions
executable file
·39 lines (34 loc) · 1004 Bytes
/
Copy pathScribe.java
File metadata and controls
executable file
·39 lines (34 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.util.HashMap;
/**
* The scribe is an expert in writing scrolls.
*
* @author ace
* @version 5 April 2010
*/
public class Scribe
{
private HashMap<String, Scroll> scrolls;
/**
* Constructor for objects of class Scribe
*/
public Scribe(){
scrolls = new HashMap<String, Scroll>();
populateHash();
}
/**
* Get a scroll of a particular description
* Valid descriptions are knowledge, virtue, and naughtiness
*
* @param String description
* @return Scroll
*/
//Scroll(String paper, String ink, String title)
public Scroll requestScroll(String description){
return scrolls.get(description);
}
private void populateHash(){
scrolls.put("knowledge", new Scroll("parchment", "glowing", "read me"));
scrolls.put("virtue", new Scroll("hemp", "fountain pen", "andreia"));
scrolls.put("naughtiness", new Scroll("film base", "black", "lady chatterly"));
}
}