Container Class

Container Class

This Package | All Packages

public class Container
implements IContainer

Provides a base class implementation of the IContainer interface.

Constructors
Name Description
Container() Creates a Container object.

Methods
Name Description
add(IComponent component) Adds a component to the container.
add(IComponent component, String name) Adds a component to the container.
dispose() Removes all components from a container.
getComponent(String name) Retreives a named component from the container.
getComponents() Retreives an array of all components from the container.
remove(IComponent component) Removes a component from the container.

Constructors

Container.Container

Syntax
public Container();
Description

Creates a Container object.

Methods

Container.add

Syntax 1
public void add( IComponent component );
Parameters
component
The component object to add.
Description

Adds a component to the container.



Syntax 2
public void add( IComponent component, String name );
Parameters
component
The component object to add.
name
The name of the component being added.
Description

Adds a component to the container.

Container.dispose

Syntax
public void dispose();
Description

Removes all components from a container.

Container.getComponent

Syntax
public IComponent getComponent( String name );
Parameters
name
The name of the component to retrieve.
Return Value

Returns the component requested, or null if this component is not found.

Description

Retreives a named component from the container.

Container.getComponents

Syntax
public IComponent[] getComponents();
Return Value

Returns all components currently sited in this container.

Description

Retreives an array of all components from the container.

Container.remove

Syntax
public void remove( IComponent component );
Parameters
component
The component to remove.
Description

Removes a component from the container.