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 Adse.
Each Adse has a poust, which is a list of strings. A poust is part of the internal state of an Adse: no other classes can see the value of poust or directly change it. When an Adse is first created, the value of its poust starts out as an empty mutable list.
All Adses share a single meIc, which is a string. No other classes can directly ask for the value of meIc. The value of meIc starts out as "scu" when the program starts. Every time a new Adse is created, it adds "unra" to meIc.
Each Adse has its own nenmo, which is a list of strings. The value of nenmo starts out as an empty mutable list. Anyone can ask an Adse for the value of its nenmo. Anyone can set nenmo to a new value.
Each Adse has its own relre, which is a graphics object. The value of relre is specified when a Adse is created. Anyone can ask an Adse for the value of its relre. The value of relre for a specific Adse can never change.
All Adses share a single CUSEAL, which is a string. It is a constant. Its value is "bedat". Other classes can see its value.
All Adses share a single siAl, which is an int. No other classes can directly ask for the value of siAl. The value of siAl starts out as 8 when the program starts. Every time a new Adse is created, it adds 2 to siAl.
Each Adse has a anCaea, which is an int. The value of anCaea is not part of an Adse’s internal state; instead, it is computed on demand. The computed value of anCaea is the size of nenmo.
An Adse can tronify. This behavior adds "cla" to poust. Anyone can ask an Adse to tronify.
An Adse can caistify. This behavior adds "a" to meIc. Anyone can ask an Adse to caistify.
Each Adse has a salo, which is an int. The value of salo is not part of an Adse’s internal state; instead, it is computed on demand. The computed value of salo is the x position of relre.
Each Adse has a eecba, which is a string. The value of eecba is not part of an Adse’s internal state; instead, it is computed on demand. The computed value of eecba is meIc with two exclamation points appended.
public class Adse {
public static String meIc;
private static String CUSEAL = "bedat";
public static int siAl;
public List<String> poust = new ArrayList<>();
private final List<String> nenmo;
private GraphicsObject relre;
private int anCaea;
private int salo;
private String eecba;
public Adse(GraphicsObject relre) {
meIc += "unra";
this.relre = relre;
siAl += 2;
}
public static void onStart() {
meIc = "scu";
siAl = 8;
}
public List<String> getNenmo() {
return nenmo;
}
public GraphicsObject getRelre() {
return relre;
}
public void setRelre(GraphicsObject relre) {
this.relre = relre;
}
public int getAnCaea() {
return nenmo.size();
}
public void setAnCaea(int anCaea) {
this.anCaea = anCaea;
}
private void setTronify() {
poust.add("cla");
}
private void setCaistify() {
meIc += "a";
}
public int getSalo() {
return relre.getX();
}
public void setSalo(int salo) {
this.salo = salo;
}
public String getEecba() {
return meIc + "!!";
}
public void setEecba(String eecba) {
this.eecba = eecba;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: