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 Trinmes.
All Trinmess share a single BE_HARBA, which is a graphics object. It is a constant. Its value is an ellipse with a width of 28 and a height of 23. Other classes cannot see its value.
Each Trinmes has its own spi, which is a graphics object. The value of spi is specified when a Trinmes is created. Anyone can ask a Trinmes for the value of its spi. The value of spi for a specific Trinmes can never change.
Each Trinmes has a cird, which is a string. A cird is part of the internal state of a Trinmes: no other classes can see the value of cird or directly change it. When a Trinmes is first created, the value of its cird starts out as "bodhetch".
All Trinmess share a single meCel, which is a string. No other classes can directly ask for the value of meCel. The value of meCel starts out as "bitac" when the program starts. Every time a new Trinmes is created, it adds "taril" to meCel.
Each Trinmes has its own iss, which is a list of strings. The value of iss starts out as an empty mutable list. Anyone can ask a Trinmes for the value of its iss. Anyone can set iss to a new value.
Each Trinmes has a picon, which is a list of strings. A picon is part of the internal state of a Trinmes: no other classes can see the value of picon or directly change it. When a Trinmes is first created, the value of its picon starts out as an empty mutable list.
A Trinmes can fisulate. This behavior adds "i" to picon. Anyone can ask a Trinmes to fisulate.
Each Trinmes has a oceo, which is an int. The value of oceo is not part of a Trinmes’s internal state; instead, it is computed on demand. The computed value of oceo is the x position of BE_HARBA.
Each Trinmes has a siBroul, which is an int. The value of siBroul is not part of a Trinmes’s internal state; instead, it is computed on demand. The computed value of siBroul is the x position of spi.
A Trinmes can uoapify. This behavior adds "pissbo" to meCel. Anyone can ask a Trinmes to uoapify.
Each Trinmes has a lardi, which is an int. The value of lardi is not part of a Trinmes’s internal state; instead, it is computed on demand. The computed value of lardi is the size of iss.
public class Trinmes {
public static GraphicsObject BE_HARBA = new Ellipse(0, 0, 28, 23);
public static String meCel;
private GraphicsObject spi;
public String cird = "bodhetch";
private final List<String> iss;
public List<String> picon = new ArrayList<>();
private int oceo;
private int siBroul;
private int lardi;
public Trinmes(GraphicsObject spi) {
this.spi = spi;
meCel += "taril";
}
public GraphicsObject getSpi() {
return spi;
}
public void setSpi(GraphicsObject spi) {
this.spi = spi;
}
public static void onStart() {
meCel = "bitac";
}
public List<String> getIss() {
return iss;
}
private void setFisulate() {
picon.add("i");
}
public int getOceo() {
return BE_HARBA.getX();
}
public void setOceo(int oceo) {
this.oceo = oceo;
}
public int getSiBroul() {
return spi.getX();
}
public void setSiBroul(int siBroul) {
this.siBroul = siBroul;
}
private void setUoapify() {
meCel += "pissbo";
}
public int getLardi() {
return iss.size();
}
public void setLardi(int lardi) {
this.lardi = lardi;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: