Class composite.Composite
- public class Composite
- extends composite.AComponent
A concrete component that represents a collection of abstract components.
The client can use a Composite equivalently to a Leaf. Any calls to the operation()
method are simply dispatched sequentially to the AComponent children.

children
- A collection of abstract components

addChild
(AComponent)
- Adds the supplied component as a child
operation
()
- A concrete operation that can be used by a Client
removeChild
(AComponent)
- Removes a AComponent child given a reference to it

children
private AComponent[] children = new Component[10]
- A collection of abstract components. Shown here as an array, but the the system is independent of the collection's implementation.

operation
public void operation()
- A concrete operation that can be used by a Client. This method simply dipatches
the operation request sequentially to all the AComponent children.
removeChild
public AComponent removeChild(AComponent child)
- Removes a AComponent child given a reference to it. Returns the reference the child if it was found.
- Parameters:
- child -
addChild
public void addChild(AComponent child)
- Adds the supplied component as a child.
- Parameters:
- child -