public interface Composite extends Component
The Composite interface defines behavior for realizations of the Component interface that will also have children.
Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList<Component> |
component |
iComponentVisitor
iComponentListener
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component child)
This operation adds a child Component to a class that realizes the
Composite interface.
|
Component |
getComponent(int childId)
This operation retrieves a child Component to a class that realizes the
Composite interface.
|
java.util.ArrayList<Component> |
getComponents()
This operation returns all of the Components stored in the Composite.
|
int |
getNumberOfComponents()
This operations retrieves the number of child Components stored in an
instance of a class that realizes the Composite interface.
|
void |
removeComponent(int childId)
This operation removes a child Component to a class that realizes the
Composite interface.
|
register, unregister, update
clone, equals, getDescription, getId, getName, hashCode, setDescription, setId, setName
static final java.util.ArrayList<Component> component
void addComponent(Component child)
This operation adds a child Component to a class that realizes the Composite interface. This operation should notify listeners that components have been added.
child
- The Component that should be added to the Composite.
void removeComponent(int childId)
This operation removes a child Component to a class that realizes the Composite interface.
childId
- The id of the child Component that should be removed from the Composite.
Component getComponent(int childId)
This operation retrieves a child Component to a class that realizes the Composite interface.
childId
- The id of the child Component that should be retrieved from the Composite.
The child with id childId that was retrieved from the Composite. NULL if the childId was not found in the Composite.
int getNumberOfComponents()
This operations retrieves the number of child Components stored in an instance of a class that realizes the Composite interface.
The number of child Components contained in the Composite.
java.util.ArrayList<Component> getComponents()
This operation returns all of the Components stored in the Composite.
The set of Components.