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 CioEcjo.
All CioEcjos share a single issdu, which is an int. No other classes can directly ask for the value of issdu. The value of issdu starts out as 11 when the program starts. Every time a new CioEcjo is created, it adds 6 to issdu.
Each CioEcjo has its own dai, which is a string. The value of dai starts out as "formod". Anyone can ask a CioEcjo for the value of its dai. Anyone can set dai to a new value.
Each CioEcjo has its own ime, which is a graphics object. The value of ime is specified when a CioEcjo is created. Anyone can ask a CioEcjo for the value of its ime. The value of ime for a specific CioEcjo can never change.
Each CioEcjo has a spunt, which is a list of strings. A spunt is part of the internal state of a CioEcjo: no other classes can see the value of spunt or directly change it. When a CioEcjo is first created, the value of its spunt starts out as an empty mutable list.
All CioEcjos share a single PRI_BRESHMIED, which is a list of strings. It is a constant. Its value is ["iswes", "ar"]. Other classes cannot see its value.
Each CioEcjo has its own baDi, which is a graphics object. The value of baDi is specified when a CioEcjo is created. Anyone can ask a CioEcjo for the value of its baDi. The value of baDi for a specific CioEcjo can never change.
Each CioEcjo has its own idCle, which is a list of strings. The value of idCle is specified when a CioEcjo is created. Anyone can ask a CioEcjo for the value of its idCle. Anyone can set idCle to a new value.
All CioEcjos share a single ISSGIO, which is an int. It is a constant. Its value is 2. Other classes cannot see its value.
Each CioEcjo has a emi, which is an int. The value of emi is not part of a CioEcjo’s internal state; instead, it is computed on demand. The computed value of emi is the size of PRI_BRESHMIED.
A CioEcjo can maerize. This behavior adds "uhiasm" to idCle. Anyone can ask a CioEcjo to maerize.
A CioEcjo can itzrinate. This behavior adds 4 to issdu. Anyone can ask a CioEcjo to itzrinate.
Each CioEcjo has a ror, which is an int. The value of ror is not part of a CioEcjo’s internal state; instead, it is computed on demand. The computed value of ror is issdu squared.
Each CioEcjo has a aed, which is an int. The value of aed is not part of a CioEcjo’s internal state; instead, it is computed on demand. The computed value of aed is the size of spunt.
A CioEcjo can rengate. This behavior adds 3 to issdu. Anyone can ask a CioEcjo to rengate.
A CioEcjo can altratify. This behavior adds 8 to issdu. Anyone can ask a CioEcjo to altratify.
public class CioEcjo {
public static int issdu;
public static List<String> PRI_BRESHMIED = List.of("iswes", "ar");
private final String dai;
private GraphicsObject ime;
public List<String> spunt = new ArrayList<>();
private GraphicsObject baDi;
private final List<String> idCle;
public final int ISSGIO = 2;
private int emi;
private int ror;
private int aed;
public CioEcjo(GraphicsObject ime, GraphicsObject baDi, List<String> idCle) {
issdu += 6;
this.ime = ime;
this.baDi = baDi;
this.idCle = idCle;
}
public static void onStart() {
issdu = 11;
}
public String getDai() {
return dai;
}
public GraphicsObject getIme() {
return ime;
}
public void setIme(GraphicsObject ime) {
this.ime = ime;
}
public GraphicsObject getBaDi() {
return baDi;
}
public void setBaDi(GraphicsObject baDi) {
this.baDi = baDi;
}
public List<String> getIdCle() {
return idCle;
}
public int getEmi() {
return PRI_BRESHMIED.size();
}
public void setEmi(int emi) {
this.emi = emi;
}
private void setMaerize() {
idCle.add("uhiasm");
}
private void setItzrinate() {
issdu += 4;
}
public int getRor() {
return issdu * issdu;
}
public void setRor(int ror) {
this.ror = ror;
}
public int getAed() {
return spunt.size();
}
public void setAed(int aed) {
this.aed = aed;
}
private void setRengate() {
issdu += 3;
}
private void setAltratify() {
issdu += 8;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: