www.sdmetrics.com

sdmetrics.model
Class ElementPool

java.lang.Object
  |
  +--sdmetrics.model.ElementPool

public class ElementPool
extends java.lang.Object

Class to store the model elements of the UML design to be analyzed. The life cycle of an element pool is as follows:


Constructor Summary
ElementPool(MetaModel mm)
           
 
Method Summary
 java.util.ArrayList getAcceptedElements(int type)
          Return a list of accepted elements of a given metamodel type.
 java.util.ArrayList getElements(int type)
          Return a list of all elements of a given metamodel type.
 MetaModel getMetaModel()
          Retrieve metamodel on which this element pool is based.
 int getNumberOfElements()
          Get the total number of elements in the pool.
 void setFilter(java.lang.String[] filterStrings, boolean rejectNonMatching, boolean filtersEnabled, boolean calculate)
          Apply filter settings to the elements in the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementPool

public ElementPool(MetaModel mm)
Parameters:
mm - Metamodel that defines the element types and attributes.
Method Detail

setFilter

public void setFilter(java.lang.String[] filterStrings,
                      boolean rejectNonMatching,
                      boolean filtersEnabled,
                      boolean calculate)
Apply filter settings to the elements in the pool.

Parameters:
filterStrings - The list of element filters to apply.
rejectNonMatching - When this flag is true, elements not matching any of the filter strings are rejected. When the flag is false, elements matching at least one filter string are rejected.
filtersEnabled - Flag indicating if output of rejected elements is to be suppressed. If this flag is false, the filtering mechanism is disabled.
calculate - true if links to rejected elements should be considered for metrics calculation, else set this to false.

getAcceptedElements

public java.util.ArrayList getAcceptedElements(int type)
Return a list of accepted elements of a given metamodel type. If the element filter is active, this method only returns the elements that should appear in the output data tables, as per the filter settings.

Parameters:
type - The metamodel type ID of the elements to return.
Returns:
A list of all accepted elements of the specified type.

getElements

public java.util.ArrayList getElements(int type)
Return a list of all elements of a given metamodel type. For example, a list of all classes, all packages, etc. This method ignores any filter settings.

Parameters:
type - The metamodel type ID of the elements to return.
Returns:
A list of all elements of the specified type.

getMetaModel

public MetaModel getMetaModel()
Retrieve metamodel on which this element pool is based.

Returns:
This pool's metamodel instance.

getNumberOfElements

public int getNumberOfElements()
Get the total number of elements in the pool.

Returns:
The number of model elements.

www.sdmetrics.com