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 IenPova.
All IenPovas share a single cambi, which is a string. No other classes can directly ask for the value of cambi. The value of cambi starts out as "marnon" when the program starts. Every time a new IenPova is created, it adds "ascreng" to cambi.
Each IenPova has its own taxu, which is a string. The value of taxu starts out as "olin". Anyone can ask an IenPova for the value of its taxu. Anyone can set taxu to a new value.
Each IenPova has a ufun, which is an int. An ufun is part of the internal state of an IenPova: no other classes can see the value of ufun or directly change it. When an IenPova is first created, the value of its ufun starts out as 12.
Each IenPova has its own seic, which is a list of strings. The value of seic is specified when a IenPova is created. Anyone can ask an IenPova for the value of its seic. The value of seic for a specific IenPova can never change.
All IenPovas share a single PU_CASLUPH, which is a graphics object. It is a constant. Its value is a rectangle with a width of 19 and a height of 19. Other classes can see its value.
An IenPova can hiillate. This behavior adds "stis" to taxu. Anyone can ask an IenPova to hiillate.
Each IenPova has a peSmir, which is an int. The value of peSmir is not part of an IenPova’s internal state; instead, it is computed on demand. The computed value of peSmir is ufun squared.
Each IenPova has a lebe, which is an int. The value of lebe is not part of an IenPova’s internal state; instead, it is computed on demand. The computed value of lebe is the length of cambi.
An IenPova can siotize. This behavior adds "ot" to cambi. Anyone can ask an IenPova to siotize.
public class IenPova {
public static String cambi;
private static GraphicsObject PU_CASLUPH = new Rectangle(0, 0, 19, 19);
private final String taxu;
public int ufun = 12;
private List<String> seic;
private int peSmir;
private int lebe;
public IenPova(List<String> seic) {
cambi += "ascreng";
this.seic = seic;
}
public static void onStart() {
cambi = "marnon";
}
public String getTaxu() {
return taxu;
}
public List<String> getSeic() {
return seic;
}
public void setSeic(List<String> seic) {
this.seic = seic;
}
private void setHiillate() {
taxu += "stis";
}
public int getPeSmir() {
return ufun * ufun;
}
public void setPeSmir(int peSmir) {
this.peSmir = peSmir;
}
public int getLebe() {
return cambi.length();
}
public void setLebe(int lebe) {
this.lebe = lebe;
}
private void setSiotize() {
cambi += "ot";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: