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 Cishe.
Each Cishe has its own siEiol, which is a list of strings. The value of siEiol is specified when a Cishe is created. Anyone can ask a Cishe for the value of its siEiol. Anyone can set siEiol to a new value.
Each Cishe has a mioud, which is a string. A mioud is part of the internal state of a Cishe: no other classes can see the value of mioud or directly change it. When a Cishe is first created, the value of its mioud starts out as "an".
All Cishes share a single beIgar, which is a graphics object. No other classes can directly ask for the value of beIgar. The value of beIgar starts out as an ellipse with a width of 24 and a height of 33 when the program starts. Every time a new Cishe is created, it moves beIgar to the right by 1 pixels (using the moveBy method).
Each Cishe has its own mish, which is a graphics object. The value of mish is specified when a Cishe is created. Anyone can ask a Cishe for the value of its mish. The value of mish for a specific Cishe can never change.
All Cishes share a single GANO_BECOS, which is a graphics object. It is a constant. Its value is an ellipse with a width of 24 and a height of 39. Other classes cannot see its value.
A Cishe can jinrulize. This behavior adds "cil" to mioud. Anyone can ask a Cishe to jinrulize.
Each Cishe has a weWi, which is an int. The value of weWi is not part of a Cishe’s internal state; instead, it is computed on demand. The computed value of weWi is the x position of beIgar.
A Cishe can epessate. This behavior moves beIgar to the right by 3 pixels (using the moveBy method). Anyone can ask a Cishe to epessate.
Each Cishe has a acIssa, which is an int. The value of acIssa is not part of a Cishe’s internal state; instead, it is computed on demand. The computed value of acIssa is the width of GANO_BECOS.
public class Cishe {
public static GraphicsObject beIgar;
public static GraphicsObject GANO_BECOS = new Ellipse(0, 0, 24, 39);
private final List<String> siEiol;
public String mioud = "an";
private GraphicsObject mish;
private int weWi;
private int acIssa;
public Cishe(List<String> siEiol, GraphicsObject mish) {
this.siEiol = siEiol;
beIgar.moveBy(1, 0);
this.mish = mish;
}
public List<String> getSiEiol() {
return siEiol;
}
public static void onStart() {
beIgar = new Ellipse(0, 0, 24, 33);
}
public GraphicsObject getMish() {
return mish;
}
public void setMish(GraphicsObject mish) {
this.mish = mish;
}
private void setJinrulize() {
mioud += "cil";
}
public int getWeWi() {
return beIgar.getX();
}
public void setWeWi(int weWi) {
this.weWi = weWi;
}
private void setEpessate() {
beIgar.moveBy(3, 0);
}
public int getAcIssa() {
return GANO_BECOS.getWidth();
}
public void setAcIssa(int acIssa) {
this.acIssa = acIssa;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: