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 Minnash.
All Minnashs share a single SHOS_BOISSPRO, which is a graphics object. It is a constant. Its value is an ellipse with a width of 35 and a height of 42. Other classes can see its value.
Each Minnash has a bla, which is a graphics object. A bla is part of the internal state of a Minnash: no other classes can see the value of bla or directly change it. When a Minnash is first created, the value of its bla starts out as a rectangle with a width of 13 and a height of 32.
Each Minnash has its own atant, which is a string. The value of atant is specified when a Minnash is created. Anyone can ask a Minnash for the value of its atant. Anyone can set atant to a new value.
All Minnashs share a single sne, which is a graphics object. No other classes can directly ask for the value of sne. The value of sne starts out as a rectangle with a width of 37 and a height of 40 when the program starts. Every time a new Minnash is created, it moves sne to the right by 4 pixels (using the moveBy method).
Each Minnash has its own gleng, which is a graphics object. The value of gleng is specified when a Minnash is created. Anyone can ask a Minnash for the value of its gleng. The value of gleng for a specific Minnash can never change.
Each Minnash has a pePo, which is an int. The value of pePo is not part of a Minnash’s internal state; instead, it is computed on demand. The computed value of pePo is the width of sne.
A Minnash can engilize. This behavior adds "ar" to atant. Anyone can ask a Minnash to engilize.
Each Minnash has a smo, which is an int. The value of smo is not part of a Minnash’s internal state; instead, it is computed on demand. The computed value of smo is the width of sne.
A Minnash can houpize. This behavior moves sne to the right by 9 pixels (using the moveBy method). Anyone can ask a Minnash to houpize.
public class Minnash {
private static GraphicsObject SHOS_BOISSPRO = new Ellipse(0, 0, 35, 42);
public static GraphicsObject sne;
public GraphicsObject bla = new Rectangle(0, 0, 13, 32);
private final String atant;
private GraphicsObject gleng;
private int pePo;
private int smo;
public Minnash(String atant, GraphicsObject gleng) {
this.atant = atant;
sne.moveBy(4, 0);
this.gleng = gleng;
}
public String getAtant() {
return atant;
}
public static void onStart() {
sne = new Rectangle(0, 0, 37, 40);
}
public GraphicsObject getGleng() {
return gleng;
}
public void setGleng(GraphicsObject gleng) {
this.gleng = gleng;
}
public int getPePo() {
return sne.getWidth();
}
public void setPePo(int pePo) {
this.pePo = pePo;
}
private void setEngilize() {
atant += "ar";
}
public int getSmo() {
return sne.getWidth();
}
public void setSmo(int smo) {
this.smo = smo;
}
private void setHoupize() {
sne.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: