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 Iaje.
All Iajes share a single sceb, which is a graphics object. No other classes can directly ask for the value of sceb. The value of sceb starts out as an ellipse with a width of 32 and a height of 31 when the program starts. Every time a new Iaje is created, it moves sceb to the right by 8 pixels (using the moveBy method).
Each Iaje has its own geeff, which is a graphics object. The value of geeff starts out as a rectangle with a width of 29 and a height of 26. Anyone can ask an Iaje for the value of its geeff. Anyone can set geeff to a new value.
All Iajes share a single PEMPAENT, which is a graphics object. It is a constant. Its value is an ellipse with a width of 20 and a height of 44. Other classes can see its value.
Each Iaje has its own coWosfi, which is a list of strings. The value of coWosfi is specified when a Iaje is created. Anyone can ask an Iaje for the value of its coWosfi. The value of coWosfi for a specific Iaje can never change.
An Iaje can teorize. This behavior moves geeff to the right by 8 pixels (using the moveBy method). Anyone can ask an Iaje to teorize.
Each Iaje has a iass, which is an int. The value of iass is not part of an Iaje’s internal state; instead, it is computed on demand. The computed value of iass is the width of geeff.
An Iaje can essanify. This behavior moves sceb to the right by 6 pixels (using the moveBy method). Anyone can ask an Iaje to essanify.
public class Iaje {
public static GraphicsObject sceb;
private static GraphicsObject PEMPAENT = new Ellipse(0, 0, 20, 44);
private final GraphicsObject geeff;
private List<String> coWosfi;
private int iass;
public Iaje(List<String> coWosfi) {
sceb.moveBy(8, 0);
this.coWosfi = coWosfi;
}
public static void onStart() {
sceb = new Ellipse(0, 0, 32, 31);
}
public GraphicsObject getGeeff() {
return geeff;
}
public List<String> getCoWosfi() {
return coWosfi;
}
public void setCoWosfi(List<String> coWosfi) {
this.coWosfi = coWosfi;
}
private void setTeorize() {
geeff.moveBy(8, 0);
}
public int getIass() {
return geeff.getWidth();
}
public void setIass(int iass) {
this.iass = iass;
}
private void setEssanify() {
sceb.moveBy(6, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: