-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWord.java
More file actions
95 lines (78 loc) · 1.63 KB
/
Copy pathWord.java
File metadata and controls
95 lines (78 loc) · 1.63 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* @author GERARDO R PADILLA JR.
*
* This code is a basic
*
*/
public class Word {
private String word;
private String definition;
private Gtype type;
public enum Gtype {
noun, verb, adjective
};
/**
*
* @param new Word word to add
* @param Def definition of that word
* @param newType type of the new word
*/
Word(String newWord, String Def, Gtype newType) {
setWord(newWord);
setDefinition(Def);
setType(newType);
}
Word(Word NewWord) {
setWord(NewWord.getWord());
setDefinition(NewWord.getDefinition());
setType(NewWord.getType());
}
/**
* Returns the word that is here
*
* @return word that is stored in this class
*/
public String getWord() {
return word;
}
/**
* Sets the word member to the parameter
*
* @param word to be defined
*
*/
public void setWord(String word) {
this.word = word;
}
/**
* Returns the definition of the word
*
* @return definition of the word
*/
public String getDefinition() {
return definition;
}
/**
* Sets the definition member to the parameter
*
* @param definition to be added
*/
public void setDefinition(String definition) {
this.definition = definition;
}
public Gtype getType() {
return type;
}
public void setType(Gtype gType) {
this.type = gType;
}
/**
* Will print the word, type of word, and a definition
*
* @return the entire word and its information on a single line
*/
@Override
public String toString() {
return (word + ": (" + type + ") " + definition);
}
}