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 Wescir.
All Wescirs share a single teex, which is an int. No other classes can directly ask for the value of teex. The value of teex starts out as 19 when the program starts. Every time a new Wescir is created, it adds 1 to teex.
Each Wescir has a ofNud, which is a list of strings. An ofNud is part of the internal state of a Wescir: no other classes can see the value of ofNud or directly change it. When a Wescir is first created, the value of its ofNud starts out as an empty mutable list.
Each Wescir has its own poas, which is a string. The value of poas starts out as "udcas". Anyone can ask a Wescir for the value of its poas. Anyone can set poas to a new value.
All Wescirs share a single PRABO_VO, which is a graphics object. It is a constant. Its value is a rectangle with a width of 26 and a height of 13. Other classes cannot see its value.
Each Wescir has its own heRi, which is a string. The value of heRi is specified when a Wescir is created. Anyone can ask a Wescir for the value of its heRi. The value of heRi for a specific Wescir can never change.
Each Wescir has a naBi, which is an int. The value of naBi is not part of a Wescir’s internal state; instead, it is computed on demand. The computed value of naBi is the width of PRABO_VO.
A Wescir can ongate. This behavior adds "feddau" to ofNud. Anyone can ask a Wescir to ongate.
A Wescir can owlelize. This behavior adds "qooa" to ofNud. Anyone can ask a Wescir to owlelize.
Each Wescir has a waOdo, which is an int. The value of waOdo is not part of a Wescir’s internal state; instead, it is computed on demand. The computed value of waOdo is the width of PRABO_VO.
public class Wescir {
public static int teex;
public static GraphicsObject PRABO_VO = new Rectangle(0, 0, 26, 13);
public List<String> ofNud = new ArrayList<>();
private final String poas;
private String heRi;
private int naBi;
private int waOdo;
public Wescir(String heRi) {
teex += 1;
this.heRi = heRi;
}
public static void onStart() {
teex = 19;
}
public String getPoas() {
return poas;
}
public String getHeRi() {
return heRi;
}
public void setHeRi(String heRi) {
this.heRi = heRi;
}
public int getNaBi() {
return PRABO_VO.getWidth();
}
public void setNaBi(int naBi) {
this.naBi = naBi;
}
private void setOngate() {
ofNud.add("feddau");
}
private void setOwlelize() {
ofNud.add("qooa");
}
public int getWaOdo() {
return PRABO_VO.getWidth();
}
public void setWaOdo(int waOdo) {
this.waOdo = waOdo;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: