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 Rapi.
All Rapis share a single iic, which is a list of strings. No other classes can directly ask for the value of iic. The value of iic starts out as an empty mutable list when the program starts. Every time a new Rapi is created, it adds "giss" to iic.
All Rapis share a single OLHIEC, which is a string. It is a constant. Its value is "tisba". Other classes cannot see its value.
Each Rapi has a deEging, which is an int. A deEging is part of the internal state of a Rapi: no other classes can see the value of deEging or directly change it. When a Rapi is first created, the value of its deEging starts out as 16.
Each Rapi has its own auIl, which is a graphics object. The value of auIl is specified when a Rapi is created. Anyone can ask a Rapi for the value of its auIl. The value of auIl for a specific Rapi can never change.
Each Rapi has its own hesmo, which is a graphics object. The value of hesmo starts out as an ellipse with a width of 18 and a height of 31. Anyone can ask a Rapi for the value of its hesmo. Anyone can set hesmo to a new value.
All Rapis share a single ICHT_LIRIWN, which is a string. It is a constant. Its value is "vesm". Other classes cannot see its value.
All Rapis share a single rosm, which is a string. No other classes can directly ask for the value of rosm. The value of rosm starts out as "gror" when the program starts. Every time a new Rapi is created, it adds "edstro" to rosm.
A Rapi can spherate. This behavior adds "ordmia" to rosm. Anyone can ask a Rapi to spherate.
Each Rapi has a toCuci, which is a string. The value of toCuci is not part of a Rapi’s internal state; instead, it is computed on demand. The computed value of toCuci is rosm with two exclamation points appended.
Each Rapi has a socco, which is an int. The value of socco is not part of a Rapi’s internal state; instead, it is computed on demand. The computed value of socco is the x position of auIl.
A Rapi can plelify. This behavior adds "ni" to rosm. Anyone can ask a Rapi to plelify.
Each Rapi has a puta, which is an int. The value of puta is not part of a Rapi’s internal state; instead, it is computed on demand. The computed value of puta is deEging plus 6.
A Rapi can crualify. This behavior moves hesmo to the right by 7 pixels (using the moveBy method). Anyone can ask a Rapi to crualify.
public class Rapi {
public static List<String> iic;
public static String OLHIEC = "tisba";
public static String ICHT_LIRIWN = "vesm";
public static String rosm;
public int deEging = 16;
private GraphicsObject auIl;
private final GraphicsObject hesmo;
private String toCuci;
private int socco;
private int puta;
public Rapi(GraphicsObject auIl) {
iic.add("giss");
this.auIl = auIl;
rosm += "edstro";
}
public static void onStart() {
iic = new ArrayList<>();
rosm = "gror";
}
public GraphicsObject getAuIl() {
return auIl;
}
public void setAuIl(GraphicsObject auIl) {
this.auIl = auIl;
}
public GraphicsObject getHesmo() {
return hesmo;
}
private void setSpherate() {
rosm += "ordmia";
}
public String getToCuci() {
return rosm + "!!";
}
public void setToCuci(String toCuci) {
this.toCuci = toCuci;
}
public int getSocco() {
return auIl.getX();
}
public void setSocco(int socco) {
this.socco = socco;
}
private void setPlelify() {
rosm += "ni";
}
public int getPuta() {
return deEging + 6;
}
public void setPuta(int puta) {
this.puta = puta;
}
private void setCrualify() {
hesmo.moveBy(7, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: