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 Sest.
All Sests share a single IOGI_GE, which is a graphics object. It is a constant. Its value is a rectangle with a width of 14 and a height of 38. Other classes can see its value.
Each Sest has its own micen, which is a list of strings. The value of micen is specified when a Sest is created. Anyone can ask a Sest for the value of its micen. The value of micen for a specific Sest can never change.
Each Sest has a erShic, which is a string. An erShic is part of the internal state of a Sest: no other classes can see the value of erShic or directly change it. When a Sest is first created, the value of its erShic starts out as "asscen".
Each Sest has its own hio, which is an int. The value of hio is specified when a Sest is created. Anyone can ask a Sest for the value of its hio. Anyone can set hio to a new value.
All Sests share a single osSanme, which is an int. No other classes can directly ask for the value of osSanme. The value of osSanme starts out as 12 when the program starts. Every time a new Sest is created, it adds 3 to osSanme.
All Sests share a single aric, which is a list of strings. No other classes can directly ask for the value of aric. The value of aric starts out as an empty mutable list when the program starts. Every time a new Sest is created, it adds "eoo" to aric.
All Sests share a single IANG_EOSLO, which is a string. It is a constant. Its value is "pri". Other classes can see its value.
Each Sest has its own plid, which is an int. The value of plid is specified when a Sest is created. Anyone can ask a Sest for the value of its plid. The value of plid for a specific Sest can never change.
Each Sest has a anme, which is an int. The value of anme is not part of a Sest’s internal state; instead, it is computed on demand. The computed value of anme is osSanme plus 7.
A Sest can gagadify. This behavior adds 4 to osSanme. Anyone can ask a Sest to gagadify.
A Sest can odonate. This behavior adds 9 to osSanme. Anyone can ask a Sest to odonate.
Each Sest has a viCel, which is a string. The value of viCel is not part of a Sest’s internal state; instead, it is computed on demand. The computed value of viCel is IANG_EOSLO with two exclamation points appended.
Each Sest has a aoOl, which is an int. The value of aoOl is not part of a Sest’s internal state; instead, it is computed on demand. The computed value of aoOl is the length of erShic.
A Sest can trucify. This behavior adds 2 to hio. Anyone can ask a Sest to trucify.
A Sest can tipienify. This behavior adds 9 to hio. Anyone can ask a Sest to tipienify.
public class Sest {
private static GraphicsObject IOGI_GE = new Rectangle(0, 0, 14, 38);
public static int osSanme;
public static List<String> aric;
private static String IANG_EOSLO = "pri";
private List<String> micen;
public String erShic = "asscen";
private final int hio;
private int plid;
private int anme;
private String viCel;
private int aoOl;
public Sest(List<String> micen, int hio, int plid) {
this.micen = micen;
this.hio = hio;
osSanme += 3;
aric.add("eoo");
this.plid = plid;
}
public List<String> getMicen() {
return micen;
}
public void setMicen(List<String> micen) {
this.micen = micen;
}
public int getHio() {
return hio;
}
public static void onStart() {
osSanme = 12;
aric = new ArrayList<>();
}
public int getPlid() {
return plid;
}
public void setPlid(int plid) {
this.plid = plid;
}
public int getAnme() {
return osSanme + 7;
}
public void setAnme(int anme) {
this.anme = anme;
}
private void setGagadify() {
osSanme += 4;
}
private void setOdonate() {
osSanme += 9;
}
public String getViCel() {
return IANG_EOSLO + "!!";
}
public void setViCel(String viCel) {
this.viCel = viCel;
}
public int getAoOl() {
return erShic.length();
}
public void setAoOl(int aoOl) {
this.aoOl = aoOl;
}
private void setTrucify() {
hio += 2;
}
private void setTipienify() {
hio += 9;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: