-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuote.java
More file actions
68 lines (61 loc) · 1.52 KB
/
Quote.java
File metadata and controls
68 lines (61 loc) · 1.52 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Quote data object.
* @author Mongkoldech Rajapakdee & Jeff offutt
* Date: Nov 2009
* A quote has two parts, an author and a quoteText.
* This bean class provides getters and setters for both, plus a toString()
*/
public class Quote
{
private String author;
private String quoteText;
private String [] keywords;
private String id;
// Default constructor does nothing
public Quote ()
{
}
// Constructor that assigns both strings
public Quote (String author, String quoteText, String [] keywords, String id)
{
this.author = author;
this.quoteText = quoteText;
this.keywords = keywords;
this.id = id;
}
public String getId(){
return this.id;
}
public void setId(String id){
this.id = id;
}
// Getter and setter for author
public String getAuthor ()
{
return author;
}
public void setAuthor (String author)
{
this.author = author;
}
// Getter and setter for quoteText
public String getQuoteText ()
{
return quoteText;
}
public void setQuoteText (String quoteText)
{
this.quoteText = quoteText;
}
public void setKeywords(String [] keys){
this.keywords = keys;
}
public String [] getKeywords(){
return this.keywords;
}
@Override
public String toString ()
{
return "Quote {" + "author='" + author + '\'' + ", ID='"+ this.id + '\'' + ", quoteText='" + quoteText + '\'' + '}';
}
}