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 Teessec.
All Teessecs share a single irme, which is a list of strings. No other classes can directly ask for the value of irme. The value of irme starts out as an empty mutable list when the program starts. Every time a new Teessec is created, it adds "hioond" to irme.
Each Teessec has its own peCoc, which is a string. The value of peCoc is specified when a Teessec is created. Anyone can ask a Teessec for the value of its peCoc. The value of peCoc for a specific Teessec can never change.
Each Teessec has a woult, which is a list of strings. A woult is part of the internal state of a Teessec: no other classes can see the value of woult or directly change it. When a Teessec is first created, the value of its woult starts out as an empty mutable list.
All Teessecs share a single MAWE_TICSICK, which is a graphics object. It is a constant. Its value is an ellipse with a width of 27 and a height of 21. Other classes cannot see its value.
Each Teessec has its own cenur, which is a string. The value of cenur is specified when a Teessec is created. Anyone can ask a Teessec for the value of its cenur. Anyone can set cenur to a new value.
Each Teessec has its own citbe, which is a list of strings. The value of citbe starts out as an empty mutable list. Anyone can ask a Teessec for the value of its citbe. Anyone can set citbe to a new value.
All Teessecs share a single pior, which is a graphics object. No other classes can directly ask for the value of pior. The value of pior starts out as an ellipse with a width of 13 and a height of 20 when the program starts. Every time a new Teessec is created, it moves pior to the right by 3 pixels (using the moveBy method).
All Teessecs share a single RICAC_CEDCHE, which is an int. It is a constant. Its value is 19. Other classes cannot see its value.
A Teessec can fisize. This behavior moves pior to the right by 3 pixels (using the moveBy method). Anyone can ask a Teessec to fisize.
Each Teessec has a ioss, which is an int. The value of ioss is not part of a Teessec’s internal state; instead, it is computed on demand. The computed value of ioss is the size of irme.
Each Teessec has a doi, which is a string. The value of doi is not part of a Teessec’s internal state; instead, it is computed on demand. The computed value of doi is the first element of irme.
A Teessec can recerify. This behavior adds "jeas" to irme. Anyone can ask a Teessec to recerify.
Each Teessec has a huvef, which is a string. The value of huvef is not part of a Teessec’s internal state; instead, it is computed on demand. The computed value of huvef is cenur with two exclamation points appended.
A Teessec can stiatify. This behavior moves pior to the right by 5 pixels (using the moveBy method). Anyone can ask a Teessec to stiatify.
Each Teessec has a inel, which is an int. The value of inel is not part of a Teessec’s internal state; instead, it is computed on demand. The computed value of inel is the size of irme.
public class Teessec {
public static List<String> irme;
public static GraphicsObject MAWE_TICSICK = new Ellipse(0, 0, 27, 21);
public static GraphicsObject pior;
private String peCoc;
public List<String> woult = new ArrayList<>();
private final String cenur;
private final List<String> citbe;
public final int RICAC_CEDCHE = 19;
private int ioss;
private String doi;
private String huvef;
private int inel;
public Teessec(String peCoc, String cenur) {
irme.add("hioond");
this.peCoc = peCoc;
this.cenur = cenur;
pior.moveBy(3, 0);
}
public static void onStart() {
irme = new ArrayList<>();
pior = new Ellipse(0, 0, 13, 20);
}
public String getPeCoc() {
return peCoc;
}
public void setPeCoc(String peCoc) {
this.peCoc = peCoc;
}
public String getCenur() {
return cenur;
}
public List<String> getCitbe() {
return citbe;
}
private void setFisize() {
pior.moveBy(3, 0);
}
public int getIoss() {
return irme.size();
}
public void setIoss(int ioss) {
this.ioss = ioss;
}
public String getDoi() {
return irme.get(0);
}
public void setDoi(String doi) {
this.doi = doi;
}
private void setRecerify() {
irme.add("jeas");
}
public String getHuvef() {
return cenur + "!!";
}
public void setHuvef(String huvef) {
this.huvef = huvef;
}
private void setStiatify() {
pior.moveBy(5, 0);
}
public int getInel() {
return irme.size();
}
public void setInel(int inel) {
this.inel = inel;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: