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 an Essal.
All Essals share a single CRAEC_ATHE, which is a graphics object. It is a constant. Its value is a rectangle with a width of 43 and a height of 29. Other classes cannot see its value.
Each Essal has a ano, which is a string. An ano is part of the internal state of an Essal: no other classes can see the value of ano or directly change it. When an Essal is first created, the value of its ano starts out as "zuare".
All Essals share a single camor, which is a list of strings. No other classes can directly ask for the value of camor. The value of camor starts out as an empty mutable list when the program starts. Every time a new Essal is created, it adds "dashven" to camor.
Each Essal has its own stou, which is an int. The value of stou is specified when a Essal is created. Anyone can ask an Essal for the value of its stou. The value of stou for a specific Essal can never change.
Each Essal has its own elOng, which is a string. The value of elOng starts out as "mopap". Anyone can ask an Essal for the value of its elOng. Anyone can set elOng to a new value.
All Essals share a single ciac, which is a graphics object. No other classes can directly ask for the value of ciac. The value of ciac starts out as an ellipse with a width of 47 and a height of 33 when the program starts. Every time a new Essal is created, it moves ciac to the right by 5 pixels (using the moveBy method).
Each Essal has a dube, which is an int. The value of dube is not part of an Essal’s internal state; instead, it is computed on demand. The computed value of dube is the x position of ciac.
An Essal can actelize. This behavior moves ciac to the right by 5 pixels (using the moveBy method). Anyone can ask an Essal to actelize.
Each Essal has a omir, which is a string. The value of omir is not part of an Essal’s internal state; instead, it is computed on demand. The computed value of omir is the first element of camor.
An Essal can brenify. This behavior adds "se" to camor. Anyone can ask an Essal to brenify.
An Essal can freinify. This behavior moves ciac to the right by 9 pixels (using the moveBy method). Anyone can ask an Essal to freinify.
public class Essal {
public static GraphicsObject CRAEC_ATHE = new Rectangle(0, 0, 43, 29);
public static List<String> camor;
public static GraphicsObject ciac;
public String ano = "zuare";
private int stou;
private final String elOng;
private int dube;
private String omir;
public Essal(int stou) {
camor.add("dashven");
this.stou = stou;
ciac.moveBy(5, 0);
}
public static void onStart() {
camor = new ArrayList<>();
ciac = new Ellipse(0, 0, 47, 33);
}
public int getStou() {
return stou;
}
public void setStou(int stou) {
this.stou = stou;
}
public String getElOng() {
return elOng;
}
public int getDube() {
return ciac.getX();
}
public void setDube(int dube) {
this.dube = dube;
}
private void setActelize() {
ciac.moveBy(5, 0);
}
public String getOmir() {
return camor.get(0);
}
public void setOmir(String omir) {
this.omir = omir;
}
private void setBrenify() {
camor.add("se");
}
private void setFreinify() {
ciac.moveBy(9, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: