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 Fege.
Each Fege has a aciop, which is a list of strings. An aciop is part of the internal state of a Fege: no other classes can see the value of aciop or directly change it. When a Fege is first created, the value of its aciop starts out as an empty mutable list.
Each Fege has its own rao, which is a graphics object. The value of rao is specified when a Fege is created. Anyone can ask a Fege for the value of its rao. The value of rao for a specific Fege can never change.
All Feges share a single UM_SASUR, which is a graphics object. It is a constant. Its value is a rectangle with a width of 35 and a height of 47. Other classes can see its value.
Each Fege has its own ulPha, which is a graphics object. The value of ulPha starts out as a rectangle with a width of 19 and a height of 18. Anyone can ask a Fege for the value of its ulPha. Anyone can set ulPha to a new value.
All Feges share a single anrur, which is an int. No other classes can directly ask for the value of anrur. The value of anrur starts out as 2 when the program starts. Every time a new Fege is created, it adds 3 to anrur.
Each Fege has a tewri, which is a graphics object. A tewri is part of the internal state of a Fege: no other classes can see the value of tewri or directly change it. When a Fege is first created, the value of its tewri starts out as a rectangle with a width of 24 and a height of 48.
Each Fege has its own moSi, which is a list of strings. The value of moSi starts out as an empty mutable list. Anyone can ask a Fege for the value of its moSi. Anyone can set moSi to a new value.
Each Fege has its own racho, which is a list of strings. The value of racho is specified when a Fege is created. Anyone can ask a Fege for the value of its racho. The value of racho for a specific Fege can never change.
Each Fege has a niMefum, which is a string. The value of niMefum is not part of a Fege’s internal state; instead, it is computed on demand. The computed value of niMefum is the first element of racho.
A Fege can vomify. This behavior adds "hodmost" to moSi. Anyone can ask a Fege to vomify.
A Fege can pralify. This behavior adds "or" to aciop. Anyone can ask a Fege to pralify.
Each Fege has a tollu, which is a string. The value of tollu is not part of a Fege’s internal state; instead, it is computed on demand. The computed value of tollu is the first element of moSi.
A Fege can asmate. This behavior adds "pa" to moSi. Anyone can ask a Fege to asmate.
Each Fege has a viur, which is an int. The value of viur is not part of a Fege’s internal state; instead, it is computed on demand. The computed value of viur is the x position of tewri.
Each Fege has a cuQela, which is an int. The value of cuQela is not part of a Fege’s internal state; instead, it is computed on demand. The computed value of cuQela is the width of rao.
public class Fege {
private static GraphicsObject UM_SASUR = new Rectangle(0, 0, 35, 47);
public static int anrur;
public List<String> aciop = new ArrayList<>();
private GraphicsObject rao;
private final GraphicsObject ulPha;
public GraphicsObject tewri = new Rectangle(0, 0, 24, 48);
private final List<String> moSi;
private List<String> racho;
private String niMefum;
private String tollu;
private int viur;
private int cuQela;
public Fege(GraphicsObject rao, List<String> racho) {
this.rao = rao;
anrur += 3;
this.racho = racho;
}
public GraphicsObject getRao() {
return rao;
}
public void setRao(GraphicsObject rao) {
this.rao = rao;
}
public GraphicsObject getUlPha() {
return ulPha;
}
public static void onStart() {
anrur = 2;
}
public List<String> getMoSi() {
return moSi;
}
public List<String> getRacho() {
return racho;
}
public void setRacho(List<String> racho) {
this.racho = racho;
}
public String getNiMefum() {
return racho.get(0);
}
public void setNiMefum(String niMefum) {
this.niMefum = niMefum;
}
private void setVomify() {
moSi.add("hodmost");
}
private void setPralify() {
aciop.add("or");
}
public String getTollu() {
return moSi.get(0);
}
public void setTollu(String tollu) {
this.tollu = tollu;
}
private void setAsmate() {
moSi.add("pa");
}
public int getViur() {
return tewri.getX();
}
public void setViur(int viur) {
this.viur = viur;
}
public int getCuQela() {
return rao.getWidth();
}
public void setCuQela(int cuQela) {
this.cuQela = cuQela;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: