- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.java
More file actions
Latest commit
33 lines (26 loc) · 572 Bytes
/
Copy pathSettings.java
File metadata and controls
33 lines (26 loc) · 572 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
packagedesignPattern.Singleton;
publicclassSettings {
privatestaticSettingsfirstObject = null;
privateStringfont = "calibri";
privateStringcolor = "black";
privateSettings() {
}
publicstaticSettingsgetObject() {
if (firstObject == null) {
firstObject = newSettings();
}
returnfirstObject;
}
publicvoidsetFont(StringfontName) {
this.font = fontName;
}
publicvoidsetColor(StringcolorName) {
this.color = colorName;
}
publicStringgetFont() {
returnthis.font;
}
publicStringgetColor() {
returnthis.color;
}
}