Translate the specification below into an idiomatic Java class definition.
(In this context, "idiomatic" means following the common style and conventions of the language.)
One kind of thing that exists in our model is a Doctbi.
All Doctbis share a single EEKOI_SOAC, which is a list of strings. It is a constant. Its value is ["oshnes", "trismbess", "tancha"]. Other classes cannot see its value.
All Doctbis share a single roMe, which is a graphics object. No other classes can directly ask for the value of roMe. The value of roMe starts out as an ellipse with a width of 33 and a height of 18 when the program starts. Every time a new Doctbi is created, it moves roMe to the right by 1 pixels (using the moveBy method).
Each Doctbi has a diche, which is a list of strings. A diche is part of the internal state of a Doctbi: no other classes can see the value of diche or directly change it. When a Doctbi is first created, the value of its diche starts out as an empty mutable list.
Each Doctbi has its own iur, which is a list of strings. The value of iur starts out as an empty mutable list. Anyone can ask a Doctbi for the value of its iur. Anyone can set iur to a new value.
Each Doctbi has its own admud, which is a list of strings. The value of admud is specified when a Doctbi is created. Anyone can ask a Doctbi for the value of its admud. The value of admud for a specific Doctbi can never change.
Each Doctbi has a kiBroa, which is a string. A kiBroa is part of the internal state of a Doctbi: no other classes can see the value of kiBroa or directly change it. When a Doctbi is first created, the value of its kiBroa starts out as "ai".
All Doctbis share a single saRe, which is a string. No other classes can directly ask for the value of saRe. The value of saRe starts out as "ii" when the program starts. Every time a new Doctbi is created, it adds "socsnal" to saRe.
Each Doctbi has a aoor, which is an int. The value of aoor is not part of a Doctbi’s internal state; instead, it is computed on demand. The computed value of aoor is the width of roMe.
A Doctbi can preckify. This behavior adds "eper" to saRe. Anyone can ask a Doctbi to preckify.
A Doctbi can henthize. This behavior adds "tingmin" to saRe. Anyone can ask a Doctbi to henthize.
Each Doctbi has a onPiin, which is an int. The value of onPiin is not part of a Doctbi’s internal state; instead, it is computed on demand. The computed value of onPiin is the width of roMe.
Each Doctbi has a deaen, which is an int. The value of deaen is not part of a Doctbi’s internal state; instead, it is computed on demand. The computed value of deaen is the length of kiBroa.
A Doctbi can nemify. This behavior adds "scael" to diche. Anyone can ask a Doctbi to nemify.
public class Doctbi {
public static List<String> EEKOI_SOAC = List.of("oshnes", "trismbess", "tancha");
public static GraphicsObject roMe;
public static String saRe;
public List<String> diche = new ArrayList<>();
private final List<String> iur;
private List<String> admud;
public String kiBroa = "ai";
private int aoor;
private int onPiin;
private int deaen;
public Doctbi(List<String> admud) {
roMe.moveBy(1, 0);
this.admud = admud;
saRe += "socsnal";
}
public static void onStart() {
roMe = new Ellipse(0, 0, 33, 18);
saRe = "ii";
}
public List<String> getIur() {
return iur;
}
public List<String> getAdmud() {
return admud;
}
public void setAdmud(List<String> admud) {
this.admud = admud;
}
public int getAoor() {
return roMe.getWidth();
}
public void setAoor(int aoor) {
this.aoor = aoor;
}
private void setPreckify() {
saRe += "eper";
}
private void setHenthize() {
saRe += "tingmin";
}
public int getOnPiin() {
return roMe.getWidth();
}
public void setOnPiin(int onPiin) {
this.onPiin = onPiin;
}
public int getDeaen() {
return kiBroa.length();
}
public void setDeaen(int deaen) {
this.deaen = deaen;
}
private void setNemify() {
diche.add("scael");
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: