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 AecCerlil.
Each AecCerlil has a viceo, which is an int. A viceo is part of the internal state of an AecCerlil: no other classes can see the value of viceo or directly change it. When an AecCerlil is first created, the value of its viceo starts out as 12.
All AecCerlils share a single SPHOSSMA, which is a graphics object. It is a constant. Its value is an ellipse with a width of 21 and a height of 23. Other classes can see its value.
All AecCerlils share a single aac, which is an int. No other classes can directly ask for the value of aac. The value of aac starts out as 5 when the program starts. Every time a new AecCerlil is created, it adds 1 to aac.
Each AecCerlil has its own rici, which is a list of strings. The value of rici is specified when a AecCerlil is created. Anyone can ask an AecCerlil for the value of its rici. The value of rici for a specific AecCerlil can never change.
Each AecCerlil has its own luUk, which is a list of strings. The value of luUk starts out as an empty mutable list. Anyone can ask an AecCerlil for the value of its luUk. Anyone can set luUk to a new value.
Each AecCerlil has a piben, which is a list of strings. A piben is part of the internal state of an AecCerlil: no other classes can see the value of piben or directly change it. When an AecCerlil is first created, the value of its piben starts out as an empty mutable list.
An AecCerlil can docalify. This behavior adds "spek" to luUk. Anyone can ask an AecCerlil to docalify.
Each AecCerlil has a boisi, which is an int. The value of boisi is not part of an AecCerlil’s internal state; instead, it is computed on demand. The computed value of boisi is the size of luUk.
Each AecCerlil has a mamet, which is an int. The value of mamet is not part of an AecCerlil’s internal state; instead, it is computed on demand. The computed value of mamet is the size of piben.
An AecCerlil can niutate. This behavior adds 9 to aac. Anyone can ask an AecCerlil to niutate.
An AecCerlil can twossize. This behavior adds "siacpho" to piben. Anyone can ask an AecCerlil to twossize.
public class AecCerlil {
private static GraphicsObject SPHOSSMA = new Ellipse(0, 0, 21, 23);
public static int aac;
public int viceo = 12;
private List<String> rici;
private final List<String> luUk;
public List<String> piben = new ArrayList<>();
private int boisi;
private int mamet;
public AecCerlil(List<String> rici) {
aac += 1;
this.rici = rici;
}
public static void onStart() {
aac = 5;
}
public List<String> getRici() {
return rici;
}
public void setRici(List<String> rici) {
this.rici = rici;
}
public List<String> getLuUk() {
return luUk;
}
private void setDocalify() {
luUk.add("spek");
}
public int getBoisi() {
return luUk.size();
}
public void setBoisi(int boisi) {
this.boisi = boisi;
}
public int getMamet() {
return piben.size();
}
public void setMamet(int mamet) {
this.mamet = mamet;
}
private void setNiutate() {
aac += 9;
}
private void setTwossize() {
piben.add("siacpho");
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: