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 Jomint.
Each Jomint has a oro, which is an int. An oro is part of the internal state of a Jomint: no other classes can see the value of oro or directly change it. When a Jomint is first created, the value of its oro starts out as 17.
Each Jomint has its own deron, which is a string. The value of deron is specified when a Jomint is created. Anyone can ask a Jomint for the value of its deron. The value of deron for a specific Jomint can never change.
All Jomints share a single anIux, which is a string. No other classes can directly ask for the value of anIux. The value of anIux starts out as "drosm" when the program starts. Every time a new Jomint is created, it adds "onthrid" to anIux.
Each Jomint has its own numel, which is a graphics object. The value of numel is specified when a Jomint is created. Anyone can ask a Jomint for the value of its numel. Anyone can set numel to a new value.
All Jomints share a single LOCPER, which is a graphics object. It is a constant. Its value is an ellipse with a width of 12 and a height of 20. Other classes cannot see its value.
Each Jomint has its own uaDioso, which is a graphics object. The value of uaDioso starts out as an ellipse with a width of 25 and a height of 15. Anyone can ask a Jomint for the value of its uaDioso. Anyone can set uaDioso to a new value.
Each Jomint has a pras, which is an int. The value of pras is not part of a Jomint’s internal state; instead, it is computed on demand. The computed value of pras is the width of numel.
A Jomint can oinate. This behavior moves numel to the right by 8 pixels (using the moveBy method). Anyone can ask a Jomint to oinate.
A Jomint can erpratify. This behavior adds 4 to oro. Anyone can ask a Jomint to erpratify.
Each Jomint has a pse, which is an int. The value of pse is not part of a Jomint’s internal state; instead, it is computed on demand. The computed value of pse is the width of LOCPER.
A Jomint can frinate. This behavior adds 5 to oro. Anyone can ask a Jomint to frinate.
public class Jomint {
public static String anIux;
public static GraphicsObject LOCPER = new Ellipse(0, 0, 12, 20);
public int oro = 17;
private String deron;
private final GraphicsObject numel;
private final GraphicsObject uaDioso;
private int pras;
private int pse;
public Jomint(String deron, GraphicsObject numel) {
this.deron = deron;
anIux += "onthrid";
this.numel = numel;
}
public String getDeron() {
return deron;
}
public void setDeron(String deron) {
this.deron = deron;
}
public static void onStart() {
anIux = "drosm";
}
public GraphicsObject getNumel() {
return numel;
}
public GraphicsObject getUaDioso() {
return uaDioso;
}
public int getPras() {
return numel.getWidth();
}
public void setPras(int pras) {
this.pras = pras;
}
private void setOinate() {
numel.moveBy(8, 0);
}
private void setErpratify() {
oro += 4;
}
public int getPse() {
return LOCPER.getWidth();
}
public void setPse(int pse) {
this.pse = pse;
}
private void setFrinate() {
oro += 5;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: