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 Kian.
All Kians share a single WO_RANKENT, which is a list of strings. It is a constant. Its value is ["scor", "cisren"]. Other classes can see its value.
All Kians share a single runmo, which is an int. No other classes can directly ask for the value of runmo. The value of runmo starts out as 3 when the program starts. Every time a new Kian is created, it adds 9 to runmo.
Each Kian has its own agoss, which is a string. The value of agoss starts out as "pulboc". Anyone can ask a Kian for the value of its agoss. Anyone can set agoss to a new value.
Each Kian has a suSqua, which is an int. A suSqua is part of the internal state of a Kian: no other classes can see the value of suSqua or directly change it. When a Kian is first created, the value of its suSqua starts out as 8.
Each Kian has its own weSor, which is an int. The value of weSor is specified when a Kian is created. Anyone can ask a Kian for the value of its weSor. The value of weSor for a specific Kian can never change.
All Kians share a single SO_OLO, which is an int. It is a constant. Its value is 12. Other classes cannot see its value.
Each Kian has a paEro, which is a graphics object. A paEro is part of the internal state of a Kian: no other classes can see the value of paEro or directly change it. When a Kian is first created, the value of its paEro starts out as a rectangle with a width of 25 and a height of 30.
All Kians share a single qaEnin, which is a string. No other classes can directly ask for the value of qaEnin. The value of qaEnin starts out as "pleuste" when the program starts. Every time a new Kian is created, it adds "tiriash" to qaEnin.
Each Kian has a deni, which is an int. The value of deni is not part of a Kian’s internal state; instead, it is computed on demand. The computed value of deni is weSor squared.
A Kian can popsutify. This behavior adds "uf" to agoss. Anyone can ask a Kian to popsutify.
A Kian can duranify. This behavior adds "treabea" to agoss. Anyone can ask a Kian to duranify.
Each Kian has a ploic, which is an int. The value of ploic is not part of a Kian’s internal state; instead, it is computed on demand. The computed value of ploic is the size of WO_RANKENT.
A Kian can beiasize. This behavior adds "krec" to qaEnin. Anyone can ask a Kian to beiasize.
Each Kian has a risdo, which is an int. The value of risdo is not part of a Kian’s internal state; instead, it is computed on demand. The computed value of risdo is suSqua squared.
Each Kian has a vaud, which is an int. The value of vaud is not part of a Kian’s internal state; instead, it is computed on demand. The computed value of vaud is the length of agoss.
public class Kian {
private static List<String> WO_RANKENT = List.of("scor", "cisren");
public static int runmo;
public static String qaEnin;
private final String agoss;
public int suSqua = 8;
private int weSor;
public final int SO_OLO = 12;
public GraphicsObject paEro = new Rectangle(0, 0, 25, 30);
private int deni;
private int ploic;
private int risdo;
private int vaud;
public Kian(int weSor) {
runmo += 9;
this.weSor = weSor;
qaEnin += "tiriash";
}
public static void onStart() {
runmo = 3;
qaEnin = "pleuste";
}
public String getAgoss() {
return agoss;
}
public int getWeSor() {
return weSor;
}
public void setWeSor(int weSor) {
this.weSor = weSor;
}
public int getDeni() {
return weSor * weSor;
}
public void setDeni(int deni) {
this.deni = deni;
}
private void setPopsutify() {
agoss += "uf";
}
private void setDuranify() {
agoss += "treabea";
}
public int getPloic() {
return WO_RANKENT.size();
}
public void setPloic(int ploic) {
this.ploic = ploic;
}
private void setBeiasize() {
qaEnin += "krec";
}
public int getRisdo() {
return suSqua * suSqua;
}
public void setRisdo(int risdo) {
this.risdo = risdo;
}
public int getVaud() {
return agoss.length();
}
public void setVaud(int vaud) {
this.vaud = vaud;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: