org.pf.tools.cda.base.model
Class ComponentModel

java.lang.Object
  extended by org.pf.tools.cda.base.model.ComponentModel
All Implemented Interfaces:
IComponentHolder

public class ComponentModel
extends java.lang.Object
implements IComponentHolder

An envelope around a set of components an their dependencies.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
ComponentModel(java.lang.String modelName, Workset aWorkset)
          Initialize the new instance with a name and a workset.
ComponentModel(Workset aWorkset)
          Initialize the new instance with a workset.
 
Method Summary
 void addComponent(SoftwareComponent component)
          Add the given component
 SoftwareComponent[] getComponents()
          Returns all containers that are hold by this object
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 IComponentHolder getParentComponentHolder()
          Returns the parent holder that contains this object.
 Workset getWorkset()
           
 java.util.List<ClassPackage> initializePackages()
          Scans the given workset for all packages that match a pattern of one of the components in the component model.
 boolean processSoftwareComponents(java.util.Collection collection, ISoftwareComponentProcessor processor)
          Calls the given processor for each contained component object and adds all component objects that the processor wants to the given collection.
 void removeComponent(SoftwareComponent component)
          Remove the given component
 void setDescription(java.lang.String newValue)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentModel

public ComponentModel(Workset aWorkset)
Initialize the new instance with a workset.


ComponentModel

public ComponentModel(java.lang.String modelName,
                      Workset aWorkset)
Initialize the new instance with a name and a workset.

Method Detail

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String newValue)

getWorkset

public Workset getWorkset()

getComponents

public SoftwareComponent[] getComponents()
Description copied from interface: IComponentHolder
Returns all containers that are hold by this object

Specified by:
getComponents in interface IComponentHolder

getParentComponentHolder

public IComponentHolder getParentComponentHolder()
Description copied from interface: IComponentHolder
Returns the parent holder that contains this object. If this object has no parent null will be returned.

Specified by:
getParentComponentHolder in interface IComponentHolder

addComponent

public void addComponent(SoftwareComponent component)
Description copied from interface: IComponentHolder
Add the given component

Specified by:
addComponent in interface IComponentHolder

removeComponent

public void removeComponent(SoftwareComponent component)
Remove the given component

Specified by:
removeComponent in interface IComponentHolder

processSoftwareComponents

public boolean processSoftwareComponents(java.util.Collection collection,
                                         ISoftwareComponentProcessor processor)
Calls the given processor for each contained component object and adds all component objects that the processor wants to the given collection.

Parameters:
collection - The collection to which the matching objects will be added (might be null)
processor - The processor that decides whether or not an object must be added (must not be null)
Returns:
true if processing should continue, otherwise false

initializePackages

public java.util.List<ClassPackage> initializePackages()
Scans the given workset for all packages that match a pattern of one of the components in the component model. Returns a list of all those packages that are not yet associated with a component.