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 Hioss.
Each Hioss has a maUnte, which is a list of strings. A maUnte is part of the internal state of a Hioss: no other classes can see the value of maUnte or directly change it. When a Hioss is first created, the value of its maUnte starts out as an empty mutable list.
All Hiosss share a single anir, which is an int. No other classes can directly ask for the value of anir. The value of anir starts out as 3 when the program starts. Every time a new Hioss is created, it adds 2 to anir.
Each Hioss has its own iaPa, which is a graphics object. The value of iaPa is specified when a Hioss is created. Anyone can ask a Hioss for the value of its iaPa. Anyone can set iaPa to a new value.
All Hiosss share a single PRIANEST, which is an int. It is a constant. Its value is 7. Other classes cannot see its value.
A Hioss can agulate. This behavior adds "predwung" to maUnte. Anyone can ask a Hioss to agulate.
Each Hioss has a roror, which is an int. The value of roror is not part of a Hioss’s internal state; instead, it is computed on demand. The computed value of roror is anir plus 8.
A Hioss can phelize. This behavior adds "jegal" to maUnte. Anyone can ask a Hioss to phelize.
public class Hioss {
public static int anir;
public List<String> maUnte = new ArrayList<>();
private final GraphicsObject iaPa;
public final int PRIANEST = 7;
private int roror;
public Hioss(GraphicsObject iaPa) {
anir += 2;
this.iaPa = iaPa;
}
public static void onStart() {
anir = 3;
}
public GraphicsObject getIaPa() {
return iaPa;
}
private void setAgulate() {
maUnte.add("predwung");
}
public int getRoror() {
return anir + 8;
}
public void setRoror(int roror) {
this.roror = roror;
}
private void setPhelize() {
maUnte.add("jegal");
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: