public class Model extends java.lang.Object implements java.lang.Iterable<ModelElement>
Constructor and Description |
---|
Model(MetaModel metaModel)
Creates a new, empty model.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ModelElement> |
getAcceptedElements(MetaModelElement type)
Returns the list of accepted elements of a given type.
|
java.util.List<ModelElement> |
getElements(MetaModelElement type)
Returns the list of all elements of a given type.
|
MetaModel |
getMetaModel()
Retrieves the metamodel on which this model is based.
|
java.util.Iterator<ModelElement> |
iterator()
Returns an iterator over all model elements of the model, ignoring any
filters settings.
|
void |
setFilter(java.lang.String[] filterStrings,
boolean acceptMatchingElements,
boolean ignoreRelationsToRejectedElements)
Applies filter settings to the elements of this model.
|
public Model(MetaModel metaModel)
metaModel
- Metamodel that defines the element types and attributes.public void setFilter(java.lang.String[] filterStrings, boolean acceptMatchingElements, boolean ignoreRelationsToRejectedElements)
filterStrings
- The list of element filters to apply. Can be
null
or empty to disable filtering.acceptMatchingElements
- Set to true
to accept elements
matching at least on of the element filters. Set to
false
to accept only elements that matching none of
the element filters.ignoreRelationsToRejectedElements
- Set to true
to
ignore links to rejected elements for metrics calculation, set to
false
to include links to rejected elements for
metrics calculation.public java.util.List<ModelElement> getElements(MetaModelElement type)
type
- The type ID of the elements to return.public java.util.List<ModelElement> getAcceptedElements(MetaModelElement type)
type
- The type of the elements to return.public java.util.Iterator<ModelElement> iterator()
iterator
in interface java.lang.Iterable<ModelElement>
public MetaModel getMetaModel()