-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTopic.java
More file actions
68 lines (63 loc) · 1.69 KB
/
Topic.java
File metadata and controls
68 lines (63 loc) · 1.69 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
import java.io.*;
/**
* @author JavaDoc
* Represents a module topic
*/
public class Topic {
private String title;
private String description;
/**
* Constructor to initialize a Topic.
* @param topicTitle String of topic title.
* @param topicDescription String of topic description.
*/
public Topic(String topicTitle, String topicDescription) {
this.title = topicTitle;
this.description = topicDescription;
}
/**
* Returns the title of the topic.
* @return The title of the topic.
*/
public String getTitle() {
return title;
}
/**
* Sets the title of the topic.
* @param title The title of the topic.
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Returns the description of the topic.
* @return The description of the topic.
*/
public String getDescription() {
return description;
}
/**
* Sets the description of the topic.
* @param description The description of the topic.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* prints out detials reagrding to the topic title
* and topic's description
*/
public void displayDetails(){
System.out.println(" Title" + title);
System.out.println(" Topic description: " + description);
}
/**
* writes out detail to the filr such as title
* and it's descrption
* @param out
*/
public void displayDetailsToFile(PrintWriter out){
out.println(" Title" + title);
out.println(" Topic description: " + description);
}
}