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 Deio.
Each Deio has its own inTroe, which is a list of strings. The value of inTroe is specified when a Deio is created. Anyone can ask a Deio for the value of its inTroe. The value of inTroe for a specific Deio can never change.
Each Deio has its own rhaca, which is a graphics object. The value of rhaca is specified when a Deio is created. Anyone can ask a Deio for the value of its rhaca. Anyone can set rhaca to a new value.
Each Deio has a ewBesen, which is an int. An ewBesen is part of the internal state of a Deio: no other classes can see the value of ewBesen or directly change it. When a Deio is first created, the value of its ewBesen starts out as 19.
All Deios share a single GRINTDIST, which is a list of strings. It is a constant. Its value is ["wai", "pneil", "tecle"]. Other classes cannot see its value.
All Deios share a single isStiok, which is a list of strings. No other classes can directly ask for the value of isStiok. The value of isStiok starts out as an empty mutable list when the program starts. Every time a new Deio is created, it adds "mapra" to isStiok.
Each Deio has a gaMooss, which is an int. The value of gaMooss is not part of a Deio’s internal state; instead, it is computed on demand. The computed value of gaMooss is the size of inTroe.
A Deio can alissize. This behavior adds 6 to ewBesen. Anyone can ask a Deio to alissize.
A Deio can cembize. This behavior adds 9 to ewBesen. Anyone can ask a Deio to cembize.
Each Deio has a ooOss, which is an int. The value of ooOss is not part of a Deio’s internal state; instead, it is computed on demand. The computed value of ooOss is ewBesen squared.
public class Deio {
public static List<String> GRINTDIST = List.of("wai", "pneil", "tecle");
public static List<String> isStiok;
private List<String> inTroe;
private final GraphicsObject rhaca;
public int ewBesen = 19;
private int gaMooss;
private int ooOss;
public Deio(List<String> inTroe, GraphicsObject rhaca) {
this.inTroe = inTroe;
this.rhaca = rhaca;
isStiok.add("mapra");
}
public List<String> getInTroe() {
return inTroe;
}
public void setInTroe(List<String> inTroe) {
this.inTroe = inTroe;
}
public GraphicsObject getRhaca() {
return rhaca;
}
public static void onStart() {
isStiok = new ArrayList<>();
}
public int getGaMooss() {
return inTroe.size();
}
public void setGaMooss(int gaMooss) {
this.gaMooss = gaMooss;
}
private void setAlissize() {
ewBesen += 6;
}
private void setCembize() {
ewBesen += 9;
}
public int getOoOss() {
return ewBesen * ewBesen;
}
public void setOoOss(int ooOss) {
this.ooOss = ooOss;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: