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 Rerin.
Each Rerin has a scre, which is a graphics object. A scre is part of the internal state of a Rerin: no other classes can see the value of scre or directly change it. When a Rerin is first created, the value of its scre starts out as a rectangle with a width of 37 and a height of 14.
All Rerins share a single urdan, which is a string. No other classes can directly ask for the value of urdan. The value of urdan starts out as "qinwiss" when the program starts. Every time a new Rerin is created, it adds "tirank" to urdan.
Each Rerin has its own iss, which is a string. The value of iss is specified when a Rerin is created. Anyone can ask a Rerin for the value of its iss. The value of iss for a specific Rerin can never change.
All Rerins share a single CRACAST, which is a string. It is a constant. Its value is "ve". Other classes can see its value.
Each Rerin has its own beel, which is a graphics object. The value of beel starts out as an ellipse with a width of 14 and a height of 34. Anyone can ask a Rerin for the value of its beel. Anyone can set beel to a new value.
All Rerins share a single HI_PEOUNT, which is a graphics object. It is a constant. Its value is a rectangle with a width of 14 and a height of 40. Other classes cannot see its value.
All Rerins share a single derd, which is a graphics object. No other classes can directly ask for the value of derd. The value of derd starts out as an ellipse with a width of 34 and a height of 17 when the program starts. Every time a new Rerin is created, it moves derd to the right by 9 pixels (using the moveBy method).
Each Rerin has a heche, which is an int. The value of heche is not part of a Rerin’s internal state; instead, it is computed on demand. The computed value of heche is the length of urdan.
A Rerin can atotize. This behavior moves derd to the right by 1 pixels (using the moveBy method). Anyone can ask a Rerin to atotize.
A Rerin can respelify. This behavior moves beel to the right by 8 pixels (using the moveBy method). Anyone can ask a Rerin to respelify.
Each Rerin has a umer, which is an int. The value of umer is not part of a Rerin’s internal state; instead, it is computed on demand. The computed value of umer is the width of beel.
A Rerin can eniarify. This behavior moves scre to the right by 9 pixels (using the moveBy method). Anyone can ask a Rerin to eniarify.
Each Rerin has a meEna, which is an int. The value of meEna is not part of a Rerin’s internal state; instead, it is computed on demand. The computed value of meEna is the width of scre.
public class Rerin {
public static String urdan;
private static String CRACAST = "ve";
public static GraphicsObject HI_PEOUNT = new Rectangle(0, 0, 14, 40);
public static GraphicsObject derd;
public GraphicsObject scre = new Rectangle(0, 0, 37, 14);
private String iss;
private final GraphicsObject beel;
private int heche;
private int umer;
private int meEna;
public Rerin(String iss) {
urdan += "tirank";
this.iss = iss;
derd.moveBy(9, 0);
}
public static void onStart() {
urdan = "qinwiss";
derd = new Ellipse(0, 0, 34, 17);
}
public String getIss() {
return iss;
}
public void setIss(String iss) {
this.iss = iss;
}
public GraphicsObject getBeel() {
return beel;
}
public int getHeche() {
return urdan.length();
}
public void setHeche(int heche) {
this.heche = heche;
}
private void setAtotize() {
derd.moveBy(1, 0);
}
private void setRespelify() {
beel.moveBy(8, 0);
}
public int getUmer() {
return beel.getWidth();
}
public void setUmer(int umer) {
this.umer = umer;
}
private void setEniarify() {
scre.moveBy(9, 0);
}
public int getMeEna() {
return scre.getWidth();
}
public void setMeEna(int meEna) {
this.meEna = meEna;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: