edu.cmu.sei.aadl.model.util
Class AadlUtil

java.lang.Object
  extended by edu.cmu.sei.aadl.model.util.AadlUtil

public final class AadlUtil
extends java.lang.Object

Static utility methods for processing AADL meta model objects.

Author:
phf

Method Summary
static boolean addClassifier(AObject nameSpace, Classifier classifier)
          add classifier to the name space.
static boolean canImplement(ComponentImpl impl, ComponentType type)
          Check to see that a component type and a component implementation have the same category
static boolean canImplement(FlowImpl fi, FlowSpec fs)
          Check whether the flow spec and flow impl are both flow paths, flow sources, or flow sinks
static java.util.List<org.eclipse.emf.ecore.EObject> copyList(java.util.List list)
          Returns a list of the self-contained copies of each EObject in the given list.
static int countElementsBySubclass(AObject root, java.lang.Class clazz)
          For the subtree rooted at the given node, count the number of model elements whose class extends from the given model element type.
static int countElementsBySubclass(AObject root, java.lang.Class[] classes)
          For the subtree rooted at the given node, count the number of model elements whose class extends from one of the given model element types.
static int countElementsExactClass(AObject root, java.lang.Class clazz)
          For the subtree rooted at the given node, count the number of model elements whose class is the given model element type.
static int countElementsExactClass(AObject root, java.lang.Class[] classes)
          For the subtree rooted at the given node, count the number of model elements whose class is one of the given model element types.
static AObject findAObject(AObject modelelement, int location)
          find the Aobject whose location reference is close to the line number
static Classifier findClassifierInNameSpace(AObject fromNS, NamedElementReference ner)
          Find a component classifier by name.
static ConnectionInstance findConnectionInstance(InstanceObject src, InstanceObject dst)
          find the connection instance with src as its source and dst as its destination
static org.eclipse.emf.common.util.EList<NamedElement> findDoubleNamedElementsInList(java.util.List el)
          Check to see if all NamedElements in the Elist have a unique name.
static org.eclipse.emf.ecore.EClass findMetaModelClass(java.lang.String classname)
          find Meta model class object in meta model packages
static NamedElement findNamedElementInList(java.util.List el, java.lang.String name)
          find (first) Named Element matching name in the Elist; any elements that are not NamedElements are skipped.
static org.eclipse.emf.common.util.EList<NamedElement> findNamedElementsInList(java.util.List el, java.lang.String name)
          find all Named Elements matching name in the Elist; any elements that are not NamedElements are skipped.
static org.eclipse.emf.common.util.EList<ComponentImpl> getAllComponentImpl()
          Get all component implementations; in all anon. name spaces and from all packages (public and private parts)
static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllPropertyDefinition()
          Get all the properties defined in the global property sets.
static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllPropertyDefinition(AObject context)
          Get all the property definitions, including those defined in any local property sets.
static java.util.List<AadlPackage> getAllUsedPackages(ComponentType ct)
          get list of packages referenced by the features of the specified component type recurseively consider the features in port groups
static org.eclipse.emf.common.util.EList<AadlPackage> getAllUsedPackages(java.util.List<? extends AObject> aobjlist)
          get list of packages referenced by the features of the specified list of component classifiers or port group classifiers recursively consider the features in port groups
static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllUsedPropertyDefinition(SystemImpl si)
          Get all property definitions that are used in the Aadl model.
static org.eclipse.emf.common.util.EList getAllVisibleComponentClassifiers(AObject aobj, ComponentCategory compCat)
          Get all component classifiers that are visible from the given aobject.
static org.eclipse.emf.common.util.EList<ComponentImpl> getAllVisibleComponentImpls(AObject aobj, ComponentCategory compCat)
          Get all component implementations that are visible from the given aobject.
static org.eclipse.emf.common.util.EList<ComponentType> getAllVisibleComponentTypes(AObject aobj, ComponentCategory compCat)
          Get all component types that are visible from the given aobject.
static org.eclipse.emf.common.util.EList getAllVisiblePortGroupTypes(AObject aobj)
          Get all Port Group Types that are visible from the given aobject.
static AObject getAObject(java.lang.Object object)
          Try to generate an AObject from an object.
static ComponentClassifier getComponentClassifierSelection(ComponentInstance ci)
          get the ComponentClassifierSelection for a component instance The selection is determined by the classifier of the subcomponent, and may be overridden by a ComponentClassifierSelection property value.
protected static ComponentClassifier getComponentClassifierSelection(java.util.List proplist, java.util.List<Subcomponent> target)
          get ComponentClassifier from ComponentClassifierSelection property Find it in the property list
static org.eclipse.emf.common.util.EList<ComponentClassifier> getDeclarationOrderedComponentClassifiers(AObject aobj)
          get a sorted list of component classifier declaratations It is sorted such that subcomponents in component implementations refer to previously declared component types or implementations
static AObject getInstanceOrigin(InstanceObject io)
          returns a single AObject that represents the origin of the instance object In case of connection instances the connection declaration from out to in is used.
static java.lang.String getName(org.eclipse.emf.common.util.URI uri)
          extracts the name of the model object referenced by the uri The name is looked up if the uri format is that of AADL XPath returns null if the uri points to an unnamed model object
static org.eclipse.emf.common.util.EList<PortGroupConnection> getPortGroupConnection(java.util.Collection portconn)
          extract the set of port group connections from the list of connections
static java.lang.String getQualifiedClassName(java.lang.String classname)
          find Meta model class in meta model packages
static java.lang.String getQualifiedName(org.eclipse.emf.common.util.URI uri)
           
static org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject)
          Returns a URI for the eObject, i.e., either the eProxyURI, the URI of the eResource with the fragment produced by the eResource, or the URI consisting of just the fragment that would be produced by a default Resource with the eObject as its only contents.
static java.util.List<AadlPackage> getUsedPackages(ComponentImpl ci)
          get list of packages referenced by the features of the specified component type
static java.util.List<AadlPackage> getUsedPackages(ComponentType ct)
          get list of packages referenced by the features of the specified component type
static org.eclipse.emf.common.util.EList<AadlPackage> getUsedPackages(java.util.List<? extends AObject> aobjlist)
          get list of packages referenced by the features of the specified list of component classifiers or port group classifiers
static java.util.List<AadlPackage> getUsedPackages(PortGroupType pgt)
          get list of packages referenced by the features of the specified port group type
static boolean hasAccessSource(org.eclipse.emf.common.util.EList subcompinstances)
          determine whether a component instance has subcomponents that can have outgoing connections
static boolean hasClassifier(AObject obj)
          Does the object have a classifier reference
static boolean hasOutgoingPortSubcomponents(org.eclipse.emf.common.util.EList subcompinstances)
          determine whether a component instance has subcomponents that can have outgoing connections
static boolean hasPortComponents(ComponentImpl compimpl)
          determine whether a component instance has subcomponents with ports
static boolean isContainedIn(ComponentInstance childci, ComponentInstance parentci)
          determine whether two feature instances are the same or one is contained in the other
static boolean isokClassifierSubstitution(Classifier origin, Classifier replacement)
          checks for legal classifier substitution.
static boolean isokTypeSubstitution(ComponentType origin, ComponentType reptype)
          checks for legal type substitution.
static boolean isOutgoingAccess(Feature f)
          determine whether a feature is an outgoing access feature
static boolean isOutgoingFeature(Feature f)
          determine whether a feature can have outgoing connections
static boolean isOutgoingPort(Feature f)
          determine whether the feature is an outgoing port or port group
static boolean isSameOrContainedIn(FeatureInstance firstfi, FeatureInstance secondfi)
          determine whether two feature instances are the same or one is contained in the other
static boolean isSameOrExtends(Classifier origin, Classifier repl)
          return true if repl is the same classifier or an extension of the original
static boolean isSameOrRefined(Connection firstconn, Connection secondconn)
          determine whether two connections are the same or one is a refinement of the other
static boolean isSameOrRefined(Feature firstfi, Feature secondfi)
          determine whether two features are the same or one is a refinement of the other
static boolean isSameOrRefined(Subcomponent firstfi, Subcomponent secondfi)
          determine whether two subcomponents are the same or one is a refinement of the other
static void makeSureFoldersExist(org.eclipse.core.runtime.IPath path)
          make sure the parent folders exist.
static boolean match(FeatureContext firstfxt, FeatureContext secondfxt)
          determine whether two feature context match
static boolean matchingClassifier(Classifier source, Classifier dest)
          check to see that the source classifier matches that of the destination implementations must be the same, types must be the same; if the source is an impl and the destination is a type their types must match In case of the port group the port group types must match
static boolean oncePerMode(java.util.List list, java.util.List allModes)
          Check to ensure that there is at most one list element per mode
static java.lang.String ownPackage(AObject o, java.lang.String str)
          Removes packagename if current package
static boolean sameCategory(Subcomponent sub, ComponentClassifier c)
          Check to see if the category of the subcomponent and the classifier match
static boolean sameEClass(org.eclipse.emf.ecore.EObject c1, org.eclipse.emf.ecore.EObject c2)
          Compare the EClass of the two EObjects
static boolean uniqueNamedElementList(java.util.List el)
          Check to see if all NamedElements in the Elist have a unique name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findNamedElementInList

public static NamedElement findNamedElementInList(java.util.List el,
                                                  java.lang.String name)
find (first) Named Element matching name in the Elist; any elements that are not NamedElements are skipped.

Parameters:
el - Elist of NamedElements
name - String
Returns:
NamedElement

findNamedElementsInList

public static org.eclipse.emf.common.util.EList<NamedElement> findNamedElementsInList(java.util.List el,
                                                                                      java.lang.String name)
find all Named Elements matching name in the Elist; any elements that are not NamedElements are skipped.

Parameters:
el - Elist of NamedElements
name - String
Returns:
EList of NamedElements that match the name

findDoubleNamedElementsInList

public static org.eclipse.emf.common.util.EList<NamedElement> findDoubleNamedElementsInList(java.util.List el)
Check to see if all NamedElements in the Elist have a unique name. The list can contain object that are not NamedElements. This implementation utilizes List Iterators.

Parameters:
el - EList or NamedElements or other objects
Returns:
EList of NameElements that are defining a previously defined name

uniqueNamedElementList

public static boolean uniqueNamedElementList(java.util.List el)
Check to see if all NamedElements in the Elist have a unique name. The list can contain object that are not NamedElements. This implementation utilizes List Iterators.

Parameters:
el - EList or NamedELements or other objects
Returns:
boolean true if the list is unique.

sameEClass

public static boolean sameEClass(org.eclipse.emf.ecore.EObject c1,
                                 org.eclipse.emf.ecore.EObject c2)
Compare the EClass of the two EObjects

Parameters:
c1 - EObject
c2 - EObject
Returns:
true if their EClasses are the same

oncePerMode

public static boolean oncePerMode(java.util.List list,
                                  java.util.List allModes)
Check to ensure that there is at most one list element per mode

Parameters:
list - list of ModeMembers
Returns:
true if at most one element per mode

getAllComponentImpl

public static org.eclipse.emf.common.util.EList<ComponentImpl> getAllComponentImpl()
Get all component implementations; in all anon. name spaces and from all packages (public and private parts)

Returns:
EList of component impl

getAllVisibleComponentClassifiers

public static org.eclipse.emf.common.util.EList getAllVisibleComponentClassifiers(AObject aobj,
                                                                                  ComponentCategory compCat)
Get all component classifiers that are visible from the given aobject. This includes all globally visible component classifiers; if aobj is null, then only the global component classifiers are returned. if the AObject aobj is in an AadlSpec that is not a global package, also includes those in the anon name space or in packages local to the aadl spec Finally, if the aobject is in the proviate part of a package, also includes the classifiers defined in the private part

Parameters:
aobj - AObject
Returns:
EList of component classifiers

getAllVisibleComponentTypes

public static org.eclipse.emf.common.util.EList<ComponentType> getAllVisibleComponentTypes(AObject aobj,
                                                                                           ComponentCategory compCat)
Get all component types that are visible from the given aobject. This includes all globally visible component types; if aobj is null, then only the global component types are returned. if the AObject aobj is in an AadlSpec that is not a global package, also includes those in the anon name space or in packages local to the aadl spec Finally, if the aobject is in the proviate part of a package, also includes the types defined in the private part

Parameters:
aobj - AObject
Returns:
EList of component types

getAllVisibleComponentImpls

public static org.eclipse.emf.common.util.EList<ComponentImpl> getAllVisibleComponentImpls(AObject aobj,
                                                                                           ComponentCategory compCat)
Get all component implementations that are visible from the given aobject. This includes all globally visible component implementations; if aobj is null, then only the global component implementations are returned. if the AObject aobj is in an AadlSpec that is not a global package, also includes those in the anon name space or in packages local to the aadl spec Finally, if the aobject is in the proviate part of a package, also includes the types defined in the private part

Parameters:
aobj - AObject
Returns:
EList of component implementations

getAllVisiblePortGroupTypes

public static org.eclipse.emf.common.util.EList getAllVisiblePortGroupTypes(AObject aobj)
Get all Port Group Types that are visible from the given aobject. This includes all globally visible component classifiers; if aobj is null, then only the global component classifiers are returned. if the AObject aobj is in an AadlSpec that is not a global package, also includes those in the anon name space or in packages local to the aadl spec Finally, if the aobject is in the proviate part of a package, also includes the classifiers defined in the private part

Parameters:
aobj - AObject
Returns:
EList of port group type

getAllPropertyDefinition

public static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllPropertyDefinition()
Get all the properties defined in the global property sets.


getAllPropertyDefinition

public static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllPropertyDefinition(AObject context)
Get all the property definitions, including those defined in any local property sets.

Parameters:
context - The model object on whose behalf the lookup is being performed. See OsateResourceManager.findPropertySet(String, AObject).

getAllUsedPropertyDefinition

public static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllUsedPropertyDefinition(SystemImpl si)
Get all property definitions that are used in the Aadl model. This includes the predeclared properties and any property definitions in user declared property sets.

Parameters:
si - System Implementation
Returns:
property definitions

canImplement

public static boolean canImplement(FlowImpl fi,
                                   FlowSpec fs)
Check whether the flow spec and flow impl are both flow paths, flow sources, or flow sinks

Parameters:
fi - flow implementation
fs - flow specification
Returns:
true if the both are paths, or both sources, or both sinks

canImplement

public static boolean canImplement(ComponentImpl impl,
                                   ComponentType type)
Check to see that a component type and a component implementation have the same category

Parameters:
impl - ComponentImpl
type - ComponentType
Returns:
true if their categories match

sameCategory

public static boolean sameCategory(Subcomponent sub,
                                   ComponentClassifier c)
Check to see if the category of the subcomponent and the classifier match

Parameters:
sub - Subcomponent
c - ComponentClassifier
Returns:
true if the categories match

ownPackage

public static java.lang.String ownPackage(AObject o,
                                          java.lang.String str)
Removes packagename if current package

Parameters:
o - that contains the classsifier reference
str -
Returns:
String without package name

findClassifierInNameSpace

public static Classifier findClassifierInNameSpace(AObject fromNS,
                                                   NamedElementReference ner)
Find a component classifier by name.

Parameters:
fromNS - The package where to start the search (AadlSpec or AadlPackageSection). Necessary to determine namespace.
ner - Identification of the classifier to find.
Returns:
Reference to the classifier, null if not found.

getDeclarationOrderedComponentClassifiers

public static org.eclipse.emf.common.util.EList<ComponentClassifier> getDeclarationOrderedComponentClassifiers(AObject aobj)
get a sorted list of component classifier declaratations It is sorted such that subcomponents in component implementations refer to previously declared component types or implementations

Parameters:
aobj -
Returns:
list of component classifiers

matchingClassifier

public static boolean matchingClassifier(Classifier source,
                                         Classifier dest)
check to see that the source classifier matches that of the destination implementations must be the same, types must be the same; if the source is an impl and the destination is a type their types must match In case of the port group the port group types must match

Parameters:
source - Classifier
dest - Classifier
Returns:
true if their classifiers match

isokClassifierSubstitution

public static boolean isokClassifierSubstitution(Classifier origin,
                                                 Classifier replacement)
checks for legal classifier substitution. The standard allows a type to be refined into one of its implementations. It is also acceptable to replace a type extension if its sole purpose is to make the name visible in another package and/or to add property values In the future we can allow implementation replacement and type substitution by refined types or extended types origin or replacement may be null.

Parameters:
origin - Classifier
replacement - Classifier
Returns:
true if the classifier can be substituted

isokTypeSubstitution

public static boolean isokTypeSubstitution(ComponentType origin,
                                           ComponentType reptype)
checks for legal type substitution. It is acceptable to replace a type extension if its sole purpose is to make the name visible in another package and/or to add property values In the future we can allow type substitution by refined types or extended types origin or replacement may be null.

Parameters:
origin - Component type
reptype - type Component type
Returns:
true if the Component type can be substituted

isSameOrExtends

public static boolean isSameOrExtends(Classifier origin,
                                      Classifier repl)
return true if repl is the same classifier or an extension of the original

Parameters:
origin - Classifier
repl - Classifier
Returns:
boolean true if repl is an extension of origin

getPortGroupConnection

public static org.eclipse.emf.common.util.EList<PortGroupConnection> getPortGroupConnection(java.util.Collection portconn)
extract the set of port group connections from the list of connections

Parameters:
portconn - list of port connections
Returns:
list of port group connections

copyList

public static java.util.List<org.eclipse.emf.ecore.EObject> copyList(java.util.List list)
Returns a list of the self-contained copies of each EObject in the given list.

Parameters:
list - the list of objects to copy.
Returns:
the list of copies.
See Also:
EcoreUtil.copy(org.eclipse.emf.ecore.EObject)

getUsedPackages

public static org.eclipse.emf.common.util.EList<AadlPackage> getUsedPackages(java.util.List<? extends AObject> aobjlist)
get list of packages referenced by the features of the specified list of component classifiers or port group classifiers

Parameters:
aobjlist -
Returns:
list of packages

getAllUsedPackages

public static org.eclipse.emf.common.util.EList<AadlPackage> getAllUsedPackages(java.util.List<? extends AObject> aobjlist)
get list of packages referenced by the features of the specified list of component classifiers or port group classifiers recursively consider the features in port groups

Parameters:
aobjlist -
Returns:
list of packages

getUsedPackages

public static java.util.List<AadlPackage> getUsedPackages(ComponentType ct)
get list of packages referenced by the features of the specified component type

Parameters:
ct - ComponentType
Returns:
list of packages

getAllUsedPackages

public static java.util.List<AadlPackage> getAllUsedPackages(ComponentType ct)
get list of packages referenced by the features of the specified component type recurseively consider the features in port groups

Parameters:
ct - ComponentType
Returns:
list of packages

getUsedPackages

public static java.util.List<AadlPackage> getUsedPackages(ComponentImpl ci)
get list of packages referenced by the features of the specified component type

Parameters:
ci - ComponentImpl
Returns:
list of packages

getUsedPackages

public static java.util.List<AadlPackage> getUsedPackages(PortGroupType pgt)
get list of packages referenced by the features of the specified port group type

Parameters:
pgt - PortGroupType
Returns:
list of packages

getAObject

public static AObject getAObject(java.lang.Object object)
Try to generate an AObject from an object. This method is intended to be used with objects that obtained from a selection event, i.e., from the ISelectionChangedListener.selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) method.

If the object is an AObject, it is returned. Otherwise, the method tries to adapt the object to an AObject.

Parameters:
object - The object to get an AObject from.
Returns:
The AObject, or null if no AObject can be obtained from the given object.

getQualifiedClassName

public static java.lang.String getQualifiedClassName(java.lang.String classname)
find Meta model class in meta model packages

Parameters:
classname - the class name to be qualified with the package name
Returns:
String qualified class name

findMetaModelClass

public static org.eclipse.emf.ecore.EClass findMetaModelClass(java.lang.String classname)
find Meta model class object in meta model packages

Parameters:
classname - the class name to be found
Returns:
EClass classs object

findAObject

public static AObject findAObject(AObject modelelement,
                                  int location)
find the Aobject whose location reference is close to the line number

Parameters:
modelelement - The model element used as root of the search
location - line number
Returns:
AObject

getQualifiedName

public static java.lang.String getQualifiedName(org.eclipse.emf.common.util.URI uri)

getName

public static java.lang.String getName(org.eclipse.emf.common.util.URI uri)
extracts the name of the model object referenced by the uri The name is looked up if the uri format is that of AADL XPath returns null if the uri points to an unnamed model object

Parameters:
uri - refering to a model object
Returns:
String name or null

addClassifier

public static boolean addClassifier(AObject nameSpace,
                                    Classifier classifier)
add classifier to the name space. A name space is either an AadlSpec or an AadlPackageSection or a property set

Parameters:
nameSpace - an AadlSpec, AadlPackageSection
classifier -

findConnectionInstance

public static ConnectionInstance findConnectionInstance(InstanceObject src,
                                                        InstanceObject dst)
find the connection instance with src as its source and dst as its destination

Parameters:
src - InstanceObject
dst - InstanceObject
Returns:
ConnectionInstance or null if not found

getInstanceOrigin

public static AObject getInstanceOrigin(InstanceObject io)
returns a single AObject that represents the origin of the instance object In case of connection instances the connection declaration from out to in is used.

Parameters:
io - InstanceObject
Returns:
AObject

hasClassifier

public static boolean hasClassifier(AObject obj)
Does the object have a classifier reference

Parameters:
obj - AObject
Returns:
true of it has a classifier reference. This reference will be returned by getReferencedObject

countElementsBySubclass

public static int countElementsBySubclass(AObject root,
                                          java.lang.Class clazz)
For the subtree rooted at the given node, count the number of model elements whose class extends from the given model element type. For example,
   int numSubs = AadlUtil.countElementsBySubclass(root, Subcomponent.class);
 

Parameters:
root - The root of the subtree.
clazz - The class to count instances of.
Returns:
The number of model elements in the given subtree that are instances of the given class or one of its subclasses.

countElementsBySubclass

public static int countElementsBySubclass(AObject root,
                                          java.lang.Class[] classes)
For the subtree rooted at the given node, count the number of model elements whose class extends from one of the given model element types. For example,
   int count = AadlUtil.countElementsBySubclass(root, 
                 new Class[] { DataClassifier.class, BusClassifier.class });
 

Parameters:
root - The root of the subtree.
classes - The classes to count instances of.
Returns:
The number of model elements in the given subtree whose class is, or extends from, one of the given classes.

countElementsExactClass

public static int countElementsExactClass(AObject root,
                                          java.lang.Class clazz)
For the subtree rooted at the given node, count the number of model elements whose class is the given model element type. For example,
   int count = AadlUtil.countElementsExactClass(root, DataType.class);
 

Parameters:
root - The root of the subtree.
clazz - The class to count instances of.
Returns:
The number of model elements in the given subtree whose class is the given class.

countElementsExactClass

public static int countElementsExactClass(AObject root,
                                          java.lang.Class[] classes)
For the subtree rooted at the given node, count the number of model elements whose class is one of the given model element types. For example,
   int count = AadlUtil.countElementsBySubclass(root, 
                 new Class[] { DataType.class, BusType.class });
 

Parameters:
root - The root of the subtree.
classes - The classes to count instances of.
Returns:
The number of model elements in the given subtree whose class is one of the given classes.

getURI

public static org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject)
Returns a URI for the eObject, i.e., either the eProxyURI, the URI of the eResource with the fragment produced by the eResource, or the URI consisting of just the fragment that would be produced by a default Resource with the eObject as its only contents.

Parameters:
eObject - the object for which to get the URI.
Returns:
the URI for the object.

getComponentClassifierSelection

public static ComponentClassifier getComponentClassifierSelection(ComponentInstance ci)
get the ComponentClassifierSelection for a component instance The selection is determined by the classifier of the subcomponent, and may be overridden by a ComponentClassifierSelection property value.

Returns:
ComponentClassifier

getComponentClassifierSelection

protected static ComponentClassifier getComponentClassifierSelection(java.util.List proplist,
                                                                     java.util.List<Subcomponent> target)
get ComponentClassifier from ComponentClassifierSelection property Find it in the property list

Parameters:
proplist - EList of property associations
target - subcomponent list to be matched by applies to. Empty list is ok.
Returns:
ComponentClassifier

hasOutgoingPortSubcomponents

public static boolean hasOutgoingPortSubcomponents(org.eclipse.emf.common.util.EList subcompinstances)
determine whether a component instance has subcomponents that can have outgoing connections

Parameters:
subcompinstances - list of sub component instances

hasAccessSource

public static boolean hasAccessSource(org.eclipse.emf.common.util.EList subcompinstances)
determine whether a component instance has subcomponents that can have outgoing connections

Parameters:
subcompinstances - list of sub component instances

isOutgoingAccess

public static boolean isOutgoingAccess(Feature f)
determine whether a feature is an outgoing access feature

Parameters:
f - Feature
Returns:
boolean true if outgoing

isOutgoingPort

public static boolean isOutgoingPort(Feature f)
determine whether the feature is an outgoing port or port group

Parameters:
f - Feature
Returns:
boolean true if outgoing

isOutgoingFeature

public static boolean isOutgoingFeature(Feature f)
determine whether a feature can have outgoing connections

Parameters:
f - Feature
Returns:
boolean true if outgoing

hasPortComponents

public static boolean hasPortComponents(ComponentImpl compimpl)
determine whether a component instance has subcomponents with ports

Parameters:
subcompinstances - list of sub component instances

match

public static boolean match(FeatureContext firstfxt,
                            FeatureContext secondfxt)
determine whether two feature context match

Parameters:
firstfxt - feature context
secondfxt - feature context
Returns:
boolean true if same or contained in

isSameOrContainedIn

public static boolean isSameOrContainedIn(FeatureInstance firstfi,
                                          FeatureInstance secondfi)
determine whether two feature instances are the same or one is contained in the other

Parameters:
firstfi - feature instance
secondfi - feature instance that may be a port group
Returns:
boolean true if same or contained in

isSameOrRefined

public static boolean isSameOrRefined(Feature firstfi,
                                      Feature secondfi)
determine whether two features are the same or one is a refinement of the other

Parameters:
firstfi - feature
secondfi - feature
Returns:
boolean true if same or refined

isSameOrRefined

public static boolean isSameOrRefined(Connection firstconn,
                                      Connection secondconn)
determine whether two connections are the same or one is a refinement of the other

Parameters:
firstconn - Connection
secondconn - Connection
Returns:
boolean true if same or refined

isSameOrRefined

public static boolean isSameOrRefined(Subcomponent firstfi,
                                      Subcomponent secondfi)
determine whether two subcomponents are the same or one is a refinement of the other

Parameters:
firstfi - subcomponent
secondfi - subcomponent
Returns:
boolean true if same or refined

isContainedIn

public static boolean isContainedIn(ComponentInstance childci,
                                    ComponentInstance parentci)
determine whether two feature instances are the same or one is contained in the other

Parameters:
childci - component instance
parentci - feature instance that may be a port group
Returns:
boolean true if same or contained in

makeSureFoldersExist

public static void makeSureFoldersExist(org.eclipse.core.runtime.IPath path)
make sure the parent folders exist. If not they will be created. The final/last element is not tested

Parameters:
path -