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 Muasla.
Each Muasla has its own asin, which is a string. The value of asin starts out as "eunant". Anyone can ask a Muasla for the value of its asin. Anyone can set asin to a new value.
All Muaslas share a single koHa, which is an int. No other classes can directly ask for the value of koHa. The value of koHa starts out as 14 when the program starts. Every time a new Muasla is created, it adds 9 to koHa.
All Muaslas share a single SOSTKA, which is a string. It is a constant. Its value is "vurddic". Other classes can see its value.
Each Muasla has a teaso, which is a string. A teaso is part of the internal state of a Muasla: no other classes can see the value of teaso or directly change it. When a Muasla is first created, the value of its teaso starts out as "scongper".
Each Muasla has its own eccic, which is an int. The value of eccic is specified when a Muasla is created. Anyone can ask a Muasla for the value of its eccic. The value of eccic for a specific Muasla can never change.
Each Muasla has its own reshi, which is a list of strings. The value of reshi starts out as an empty mutable list. Anyone can ask a Muasla for the value of its reshi. Anyone can set reshi to a new value.
All Muaslas share a single ULUN_SUEES, which is a graphics object. It is a constant. Its value is an ellipse with a width of 35 and a height of 46. Other classes can see its value.
Each Muasla has a spha, which is a graphics object. A spha is part of the internal state of a Muasla: no other classes can see the value of spha or directly change it. When a Muasla is first created, the value of its spha starts out as a rectangle with a width of 36 and a height of 41.
A Muasla can cilbulify. This behavior adds "snich" to reshi. Anyone can ask a Muasla to cilbulify.
Each Muasla has a pecso, which is a string. The value of pecso is not part of a Muasla’s internal state; instead, it is computed on demand. The computed value of pecso is asin with two exclamation points appended.
A Muasla can lopelify. This behavior adds "saccher" to asin. Anyone can ask a Muasla to lopelify.
Each Muasla has a nibri, which is an int. The value of nibri is not part of a Muasla’s internal state; instead, it is computed on demand. The computed value of nibri is the length of teaso.
Each Muasla has a maIift, which is a string. The value of maIift is not part of a Muasla’s internal state; instead, it is computed on demand. The computed value of maIift is asin with two exclamation points appended.
A Muasla can ingosate. This behavior adds "oang" to asin. Anyone can ask a Muasla to ingosate.
A Muasla can tucize. This behavior moves spha to the right by 5 pixels (using the moveBy method). Anyone can ask a Muasla to tucize.
public class Muasla {
public static int koHa;
private static String SOSTKA = "vurddic";
private static GraphicsObject ULUN_SUEES = new Ellipse(0, 0, 35, 46);
private final String asin;
public String teaso = "scongper";
private int eccic;
private final List<String> reshi;
public GraphicsObject spha = new Rectangle(0, 0, 36, 41);
private String pecso;
private int nibri;
private String maIift;
public Muasla(int eccic) {
koHa += 9;
this.eccic = eccic;
}
public String getAsin() {
return asin;
}
public static void onStart() {
koHa = 14;
}
public int getEccic() {
return eccic;
}
public void setEccic(int eccic) {
this.eccic = eccic;
}
public List<String> getReshi() {
return reshi;
}
private void setCilbulify() {
reshi.add("snich");
}
public String getPecso() {
return asin + "!!";
}
public void setPecso(String pecso) {
this.pecso = pecso;
}
private void setLopelify() {
asin += "saccher";
}
public int getNibri() {
return teaso.length();
}
public void setNibri(int nibri) {
this.nibri = nibri;
}
public String getMaIift() {
return asin + "!!";
}
public void setMaIift(String maIift) {
this.maIift = maIift;
}
private void setIngosate() {
asin += "oang";
}
private void setTucize() {
spha.moveBy(5, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: