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 an OssStockid.
All OssStockids share a single jeShas, which is a string. No other classes can directly ask for the value of jeShas. The value of jeShas starts out as "ro" when the program starts. Every time a new OssStockid is created, it adds "or" to jeShas.
Each OssStockid has its own curm, which is a list of strings. The value of curm is specified when a OssStockid is created. Anyone can ask an OssStockid for the value of its curm. The value of curm for a specific OssStockid can never change.
All OssStockids share a single RHASRAL, which is an int. It is a constant. Its value is 3. Other classes can see its value.
Each OssStockid has a hess, which is a string. A hess is part of the internal state of an OssStockid: no other classes can see the value of hess or directly change it. When an OssStockid is first created, the value of its hess starts out as "miatcess".
Each OssStockid has its own mumar, which is a graphics object. The value of mumar starts out as an ellipse with a width of 15 and a height of 25. Anyone can ask an OssStockid for the value of its mumar. Anyone can set mumar to a new value.
Each OssStockid has a pras, which is a string. A pras is part of the internal state of an OssStockid: no other classes can see the value of pras or directly change it. When an OssStockid is first created, the value of its pras starts out as "leten".
Each OssStockid has a ies, which is a string. The value of ies is not part of an OssStockid’s internal state; instead, it is computed on demand. The computed value of ies is hess with two exclamation points appended.
An OssStockid can nissate. This behavior adds "e" to hess. Anyone can ask an OssStockid to nissate.
An OssStockid can tikify. This behavior adds "i" to jeShas. Anyone can ask an OssStockid to tikify.
Each OssStockid has a peVa, which is an int. The value of peVa is not part of an OssStockid’s internal state; instead, it is computed on demand. The computed value of peVa is the length of hess.
Each OssStockid has a prael, which is an int. The value of prael is not part of an OssStockid’s internal state; instead, it is computed on demand. The computed value of prael is the width of mumar.
public class OssStockid {
public static String jeShas;
private List<String> curm;
private final int RHASRAL = 3;
public String hess = "miatcess";
private final GraphicsObject mumar;
public String pras = "leten";
private String ies;
private int peVa;
private int prael;
public OssStockid(List<String> curm) {
jeShas += "or";
this.curm = curm;
}
public static void onStart() {
jeShas = "ro";
}
public List<String> getCurm() {
return curm;
}
public void setCurm(List<String> curm) {
this.curm = curm;
}
public GraphicsObject getMumar() {
return mumar;
}
public String getIes() {
return hess + "!!";
}
public void setIes(String ies) {
this.ies = ies;
}
private void setNissate() {
hess += "e";
}
private void setTikify() {
jeShas += "i";
}
public int getPeVa() {
return hess.length();
}
public void setPeVa(int peVa) {
this.peVa = peVa;
}
public int getPrael() {
return mumar.getWidth();
}
public void setPrael(int prael) {
this.prael = prael;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: