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 Weesspeae.
All Weesspeaes share a single GETPRERP, which is a graphics object. It is a constant. Its value is an ellipse with a width of 36 and a height of 32. Other classes cannot see its value.
All Weesspeaes share a single ecor, which is an int. No other classes can directly ask for the value of ecor. The value of ecor starts out as 1 when the program starts. Every time a new Weesspeae is created, it adds 9 to ecor.
Each Weesspeae has its own oss, which is a list of strings. The value of oss starts out as an empty mutable list. Anyone can ask a Weesspeae for the value of its oss. Anyone can set oss to a new value.
Each Weesspeae has a nir, which is an int. A nir is part of the internal state of a Weesspeae: no other classes can see the value of nir or directly change it. When a Weesspeae is first created, the value of its nir starts out as 9.
Each Weesspeae has its own naPhee, which is a list of strings. The value of naPhee is specified when a Weesspeae is created. Anyone can ask a Weesspeae for the value of its naPhee. The value of naPhee for a specific Weesspeae can never change.
Each Weesspeae has a psa, which is a list of strings. A psa is part of the internal state of a Weesspeae: no other classes can see the value of psa or directly change it. When a Weesspeae is first created, the value of its psa starts out as an empty mutable list.
Each Weesspeae has its own fiDa, which is a list of strings. The value of fiDa starts out as an empty mutable list. Anyone can ask a Weesspeae for the value of its fiDa. Anyone can set fiDa to a new value.
All Weesspeaes share a single preri, which is a list of strings. No other classes can directly ask for the value of preri. The value of preri starts out as an empty mutable list when the program starts. Every time a new Weesspeae is created, it adds "bresmis" to preri.
A Weesspeae can ciormate. This behavior adds 3 to ecor. Anyone can ask a Weesspeae to ciormate.
Each Weesspeae has a saha, which is an int. The value of saha is not part of a Weesspeae’s internal state; instead, it is computed on demand. The computed value of saha is ecor plus 6.
A Weesspeae can worate. This behavior adds "tindo" to fiDa. Anyone can ask a Weesspeae to worate.
Each Weesspeae has a ert, which is an int. The value of ert is not part of a Weesspeae’s internal state; instead, it is computed on demand. The computed value of ert is the x position of GETPRERP.
Each Weesspeae has a melo, which is an int. The value of melo is not part of a Weesspeae’s internal state; instead, it is computed on demand. The computed value of melo is the size of preri.
A Weesspeae can padelate. This behavior adds 9 to ecor. Anyone can ask a Weesspeae to padelate.
A Weesspeae can xoongize. This behavior adds "cusve" to oss. Anyone can ask a Weesspeae to xoongize.
public class Weesspeae {
public static GraphicsObject GETPRERP = new Ellipse(0, 0, 36, 32);
public static int ecor;
public static List<String> preri;
private final List<String> oss;
public int nir = 9;
private List<String> naPhee;
public List<String> psa = new ArrayList<>();
private final List<String> fiDa;
private int saha;
private int ert;
private int melo;
public Weesspeae(List<String> naPhee) {
ecor += 9;
this.naPhee = naPhee;
preri.add("bresmis");
}
public static void onStart() {
ecor = 1;
preri = new ArrayList<>();
}
public List<String> getOss() {
return oss;
}
public List<String> getNaPhee() {
return naPhee;
}
public void setNaPhee(List<String> naPhee) {
this.naPhee = naPhee;
}
public List<String> getFiDa() {
return fiDa;
}
private void setCiormate() {
ecor += 3;
}
public int getSaha() {
return ecor + 6;
}
public void setSaha(int saha) {
this.saha = saha;
}
private void setWorate() {
fiDa.add("tindo");
}
public int getErt() {
return GETPRERP.getX();
}
public void setErt(int ert) {
this.ert = ert;
}
public int getMelo() {
return preri.size();
}
public void setMelo(int melo) {
this.melo = melo;
}
private void setPadelate() {
ecor += 9;
}
private void setXoongize() {
oss.add("cusve");
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: