I have this class:
public class Gradient extends Item<GradientRep> {
/**
* Initializes a new Gradient
* @param x X-coordinate of the Item
* @param y Y-coordinate of the Item
* @param value The value of the gradient
*/
public Gradient(int x, int y, int value, String type) {
super(x, y);
this.value = value;
this.type = type;
}
....
And I would like this class to "own" some objects of class Item, for example, I would like to retrieve from class Gradient this object:
Item MyItem = new Item()
Is there an obvious way to do this?
To give some background, for now the class Gradient only represent a fixed point on a map, which is not what we want for a Gradient. So, I want to propagate this gradient, and therefore when I instantiate a Gradient, I want it to provide other Items (with different coordinates on the map, which is dealt by the class Item).