Class BallFlyweight
- public class BallFlyweight
- extends ABall
The flyweight class that determines a Ball's radius, color, and update strategy. This is a shared flyweight, so all balls share the same radius, color and update strategy.

color
container
radius
strategy

BallFlyweight
(int, Color, Container, AStrategy)

getColor
()
getContainer
()
getRadius
()
getStrategy
()
move
(Ball)
paint
(Graphics, Point)
setColor
(Color)
setRadius
(int)
setStrategy
(AStrategy)
update
(Graphics, final Ball)

radius
protected int radius
color
protected Color color
container
protected Container container
strategy
protected AStrategy strategy

BallFlyweight
public BallFlyweight(int r, Color col, Container c, AStrategy a)

getRadius
public int getRadius()
setRadius
public void setRadius(int r)
getColor
public Color getColor()
setColor
public void setColor(Color c)
getContainer
public Container getContainer()
getStrategy
public AStrategy getStrategy()
update
public void update(Graphics g, final Ball b)
move
protected void move(Ball b)
paint
protected void paint(Graphics g, Point loc)
setStrategy
public void setStrategy(AStrategy strategy)
- Parameters:
- strategy -