org.argouml.model
Interface CoreHelper

All Known Implementing Classes:
AbstractCoreHelperDecorator

public interface CoreHelper

The interface for the helper for Core.

Created from the old CoreHelper.


Method Summary
 void addAllStereotypes(Object modelElement, Collection stereos)
          Adds a collection of stereotype to some modelelement.
 void addAnnotatedElement(Object comment, Object annotatedElement)
          Adds an annotated element to a comment.
 void addClient(Object handle, Object element)
          Adds a client model element to some dependency.
 void addClientDependency(Object handle, Object dependency)
          Adds a client dependency to some modelelement.
 void addComment(Object element, Object comment)
          Add a new comment to a model element.
 void addConnection(Object handle, Object connection)
          Add an End to a connection.
 void addConstraint(Object handle, Object mc)
          Adds a constraint to some model element.
 void addDeploymentLocation(Object handle, Object node)
           
 void addElementResidence(Object handle, Object residence)
          Add an ElementResidence.
 void addFeature(Object handle, int index, Object f)
          Adds a feature to some classifier.
 void addFeature(Object handle, Object f)
          Adds a feature to some classifier.
 void addLink(Object handle, Object link)
          Add the given Link to the given Link or Association.
 void addMethod(Object handle, Object m)
          Adds a method to some operation and copies the op's attributes to the method.
 void addOwnedElement(Object handle, Object me)
          Adds a model element to some namespace.
 void addParameter(Object handle, int index, Object parameter)
          Add a Parameter to the given object at given location.
 void addParameter(Object handle, Object parameter)
          Add a Parameter to the given object.
 void addRaisedSignal(Object handle, Object sig)
          Add a raised Signal to a Message or Operation.
 void addSourceFlow(Object handle, Object flow)
          Add a source flow to a model element.
 void addStereotype(Object modelElement, Object stereo)
          Adds a stereotype to some modelelement.
 void addSupplier(Object handle, Object element)
          Adds a supplier classifier to some abstraction.
 void addSupplierDependency(Object supplier, Object dependency)
          Adds a supplier dependency to some modelelement.
 void addTaggedValue(Object handle, Object taggedValue)
          Adds a TaggedValue to a ModelElement.
 void addTargetFlow(Object handle, Object flow)
          Add a target flow to a model element.
 void clearStereotypes(Object handle)
          Removes all stereotypes from a given modelelement.
 boolean equalsAggregationKind(Object associationEnd, String kindType)
           
 Collection getAllAttributes(Object clazz)
          Returns all attributes of some classifier and of its parents.
 Collection getAllBehavioralFeatures(Object element)
          Returns all behavioralfeatures found in this element and its children.
 Collection getAllClasses(Object ns)
          Returns all classes found in this namespace and in its children.
 Collection getAllClassifiers(Object namespace)
          Returns all classifiers found in this namespace and in its children.
 Collection getAllComponents(Object ns)
          Returns all components found in this namespace and in its children.
 Collection getAllContents(Object clazz)
          Returns the contents (owned elements) of this classifier and all its parents as specified in section 2.5.3.8 of the UML 1.3 spec.
 Collection getAllDataTypes(Object ns)
          Returns all components found in this namespace and in its children.
 Collection getAllInterfaces(Object ns)
          Returns all interfaces found in this namespace and in its children.
 Collection getAllMetatypeNames()
          Returns names of all metatypes in metamodel TODO: This method rightly belongs in a separate interface dealing with instances of MOF types as opposed to UML types like all the rest of the methods here do.
 Collection getAllNodes(Object ns)
          Returns all components found in this namespace and in its children.
 Collection getAllPossibleNamespaces(Object modelElement, Object model)
          Returns all possible namespaces that may be selected by some given modelelement.
 Collection getAllRealizedInterfaces(Object o)
          Returns all interfaces that are realized by the given class or by its superclasses.
 Collection getAllSupertypes(Object cls1)
          This method returns all Classifiers of which this class is a direct or indirect subtype.
 Collection getAllVisibleElements(Object ns)
          Returns a Set containing all ModelElements visible outside of the Namespace.
 Collection getAssociatedClassifiers(Object aclassifier)
          Gets all classifiers that are associated to the given classifier (have an association relationship with the classifier).
 Collection getAssociateEnds(Object classifier)
          This method returns all opposite AssociationEnds of a given Classifier.
 Collection getAssociateEndsInh(Object classifier1)
          This method returns all opposite AssociationEnds of a given Classifier, including inherited.
 Object getAssociationEnd(Object type, Object assoc)
          Returns the associationend between a classifier and an associaton.
 Collection getAssociations(Object oclassifier)
          Returns all associations for some classifier.
 Collection getAssociations(Object from, Object to)
          Gets the associations between the classifiers from and to.
 Collection getAttributes(Object classifier)
          This method returns all attributes of a given Classifier.
 Collection getAttributesInh(Object classifier)
          This method returns all attributes of a given Classifier, including inherited.
 Collection getBehavioralFeatures(Object clazz)
          Returns all behavioral features of some classifier.
 String getBody(Object comment)
          Gets the body of a comment.
 Collection getChildren(Object o)
          Returns all children from some given generalizableelement on all levels (the complete tree excluding the generalizable element itself).
 Collection getDependencies(Object supplierObj, Object clientObj)
          Returns the dependencies between some supplier modelelement and some client modelelement.
 Object getDestination(Object relationship)
          Returns the destination of a relation.
 Collection getExtendedClassifiers(Object clazz)
          Returns all classes some generalizable element extends.
 Collection getExtendingClassifiers(Object clazz)
          Returns all classifiers that extend some classifier.
 Collection getExtendingElements(Object clazz)
          Returns all elements that extend some class.
 String getFeatureName(Object o)
          Deprecated. before 0.21.3 by tfmorris - use Facade.getName(Object)
 Object getFirstSharedNamespace(Object ns1, Object ns2)
          Gets the first namespace two namespaces share.
 Collection getFlows(Object source, Object target)
          Returns all flows from some source modelelement to a target modelelement.
 Object getGeneralization(Object achild, Object aparent)
          Gets the generalization between two generalizable elements.
 Collection getOperations(Object classifier)
          This method returns all operations of a given Classifier.
 Collection getOperationsInh(Object classifier)
          This method returns all operations of a given Classifier, including inherited.
 Collection getRealizedInterfaces(Object cls)
          Return all interfaces the given class realizes.
 Collection getRelationships(Object source, Object dest)
          Returns all relationships between the source and dest modelelement and vica versa.
 Object getReturnParameter(Object operation1)
          Deprecated. by tfmorris before 0.21.1 - use getReturnParameters
 Collection getReturnParameters(Object operation)
          Returns all return parameters for an operation.
 Object getSource(Object relationship)
          Returns the source of a relation.
 Object getSpecification(Object object)
          Returns the operation that some method realized.
 Collection getSpecifications(Object classifier)
          Returns all Interfaces of which this class is a realization.
 Collection getSubtypes(Object cls)
          This method returns all Classifiers of which this class is a direct supertype.
 Collection getSupertypes(Object ogeneralizableelement)
          This method returns all Classifiers of which this class is a direct subtype.
 boolean hasCompositeEnd(Object association)
           
 boolean isMethod(Object o)
          Deprecated. by Bob in 0.21.1. There is a duplicate method Model.getFacade().isAMethod(Object)
 boolean isOperation(Object o)
          Deprecated. by Bob in 0.21.1. There is a duplicate method Model.getFacade().isAOperation(Object)
 boolean isSubType(Object type, Object subType)
          Determine if a meta type is a subtype of another.
 boolean isValidNamespace(Object mObj, Object nsObj)
          Returns true if some modelelement may be owned by the given namespace.
 void removeAnnotatedElement(Object handle, Object me)
          Remove the given modelelement from a given comment.
 void removeClientDependency(Object handle, Object dep)
          This method removes a dependency from a model element.
 void removeConnection(Object handle, Object connection)
          Remove a connection between an Association & AssociationEnd or between a Link & LinkEnd.
 void removeConstraint(Object handle, Object cons)
          Remove the given constraint from a given ModelElement.
 void removeDeploymentLocation(Object handle, Object node)
          Remove a deployment location.
 void removeElementResidence(Object handle, Object residence)
          Remove an ElementResidence.
 void removeFeature(Object cls, Object feature)
          This method removes a feature from a classifier.
 void removeOwnedElement(Object handle, Object value)
          Removes a owned model element from a namespace.
 void removeParameter(Object handle, Object parameter)
          This method removes a parameter from an operation.
 void removeSourceFlow(Object handle, Object flow)
          Remove a source flow from a model element.
 void removeStereotype(Object handle, Object stereo)
          Removes a stereotype from some modelelement.
 void removeSupplierDependency(Object supplier, Object dependency)
          Adds a supplier dependency to some modelelement.
 void removeTaggedValue(Object handle, String name)
          Removes a named tagged value from a model element, ie subsequent calls to getTaggedValue will return null for name, at least until a tagged value with that name has been added again.
 void removeTargetFlow(Object handle, Object flow)
          Add a target flow to a model element.
 void setAbstract(Object handle, boolean flag)
          Sets if of some model element is abstract.
 void setActive(Object handle, boolean active)
          Makes a Class active.
 void setAggregation(Object handle, Object aggregationKind)
          Sets the aggregation of some model element.
 void setAnnotatedElements(Object handle, Collection elems)
          Sets the list of annotated elements of the given comment.
 void setAssociation(Object handle, Object association)
          Sets the association of some model element.
 void setAttributes(Object classifier, Collection attributes)
          This method replaces all attributes of the given classifier by the given collection of attributes.
 void setBody(Object handle, Object expr)
          Sets a body of a given Method or Constraint.
 void setBody(Object handle, String body)
          Sets the body of a comment.
 void setChangeability(Object handle, Object ck)
          Set the Changeability of a StructuralFeature or AssociationEnd.
 void setChangeable(Object handle, boolean flag)
          Set the changeability of some feature.
 void setChild(Object handle, Object child)
          Set the child for a generalization.
 void setConcurrency(Object handle, Object concurrencyKind)
          Set the concurrency of some operation.
 void setConnections(Object handle, Collection elems)
          Sets the list of connections of the given association or link.
 void setContainer(Object handle, Object component)
          Set the Container of the given ElementResidence to the given Component.
 void setDefaultValue(Object handle, Object expr)
          Sets a default value of some parameter.
 void setDiscriminator(Object handle, String discriminator)
           
 void setEnumerationLiterals(Object enumeration, List literals)
          Set the (ordered) list of literals of an Enumeration.
 void setFeature(Object elem, int i, Object impl)
          Set the feature at the given position.
 void setFeatures(Object handle, Collection features)
          Sets the features of some model element.
 void setImplementationLocation(Object handle, Object component)
          Deprecated. by tfmorris before 0.20 - use setContainer
 void setInitialValue(Object at, Object expr)
          Sets an initial value.
 void setKind(Object handle, Object kind)
          Set some parameters kind.
 void setKindToIn(Object handle)
          Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)
 void setKindToInOut(Object handle)
          Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)
 void setKindToOut(Object handle)
          Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)
 void setKindToReturn(Object handle)
          Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)
 void setLeaf(Object handle, boolean flag)
          Sets if some model element is a leaf.
 void setModelElementContainer(Object handle, Object container)
          Sets the container that owns the handle.
 void setMultiplicity(Object handle, Object arg)
          Sets a multiplicity of some model element.
 void setName(Object handle, String name)
          Sets a name of some modelelement.
 void setNamespace(Object handle, Object ns)
          Sets a namespace of some modelelement.
 void setNavigable(Object handle, boolean flag)
          Sets the navigability of some association end.
 void setOperations(Object classifier, Collection operations)
          This method replaces all operations of the given classifier by the given collection of operations.
 void setOrdering(Object handle, Object ok)
          Set the OrderingKind of a given AssociationEnd.
 void setOwner(Object handle, Object owner)
          Set the owner of a Feature.
 void setOwnerScope(Object handle, Object os)
           
 void setParameters(Object handle, Collection parameters)
          Sets the parameters of a classifier, event, objectflowstate or behavioralfeature.
 void setParent(Object handle, Object parent)
          Sets the parent of a generalization.
 void setPowertype(Object handle, Object pt)
          Set the PowerType of a Generalization.
 void setQualifiers(Object handle, Collection elems)
          Sets the qualified attributes of an association end.
 void setQuery(Object handle, boolean flag)
          Sets the query flag of a behavioral feature.
 void setRaisedSignals(Object handle, Collection raisedSignals)
          Sets the raised signals of some behavioural feature.
 void setResident(Object handle, Object resident)
           
 void setResidents(Object handle, Collection residents)
          Sets the residents of some model element.
 void setRoot(Object handle, boolean flag)
          Sets if some model element is a root.
 void setSources(Object handle, Collection specifications)
           
 void setSpecification(Object handle, boolean specification)
          Set the Specification flag for a ModelElement.
 void setSpecification(Object method, Object specification)
          Set the specification (i.e.
 void setSpecification(Object operation, String specification)
          Set the specification of an Operation.
 void setSpecifications(Object handle, Collection specifications)
          Sets the specifications of some association end.
 void setTaggedValue(Object handle, String tag, String value)
          Sets a tagged value of some modelelement.
 void setTaggedValues(Object handle, Collection taggedValues)
          Set the TaggedValues of a ModelElement.
 void setTargetScope(Object handle, Object scopeKind)
          Set the target scope of some association end or structural feature.
 void setType(Object handle, Object type)
          Sets the type of some parameter.
 void setUUID(Object handle, String uuid)
          Deprecated. by tfm for 0.20 - getUUID is guaranteed to return a value but it is not settable. If a settable ID is required, use a TaggedValued or other private mechanism.
 void setVisibility(Object handle, Object visibility)
          Set the visibility of some modelelement.
 

Method Detail

isSubType

public boolean isSubType(Object type,
                         Object subType)
Determine if a meta type is a subtype of another.

Parameters:
type - The parent metatype.
subType - The metatype to test for being a subtype.
Returns:
true is subType is a sub-type of type.

getAllSupertypes

public Collection getAllSupertypes(Object cls1)
This method returns all Classifiers of which this class is a direct or indirect subtype.

Parameters:
cls1 - the class you want to have the parents for
Returns:
a collection of the parents, each of which is a GeneralizableElement.

getSupertypes

public Collection getSupertypes(Object ogeneralizableelement)
This method returns all Classifiers of which this class is a direct subtype.

Parameters:
ogeneralizableelement - the class you want to have the parents for
Returns:
a collection of the parents, each of which is a GeneralizableElement.

getAssociateEnds

public Collection getAssociateEnds(Object classifier)
This method returns all opposite AssociationEnds of a given Classifier.

Parameters:
classifier - the classifier you want to have the opposite association ends for
Returns:
a collection of the opposite associationends

getAssociateEndsInh

public Collection getAssociateEndsInh(Object classifier1)
This method returns all opposite AssociationEnds of a given Classifier, including inherited.

Parameters:
classifier1 - the classifier you want to have the opposite association ends for
Returns:
a collection of the opposite associationends

removeFeature

public void removeFeature(Object cls,
                          Object feature)
This method removes a feature from a classifier.

Parameters:
cls - the classifier
feature - the feature to be removed

getFeatureName

public String getFeatureName(Object o)
Deprecated. before 0.21.3 by tfmorris - use Facade.getName(Object)

This method returns the name of a feature.

Parameters:
o - is the feature
Returns:
name

isMethod

public boolean isMethod(Object o)
Deprecated. by Bob in 0.21.1. There is a duplicate method Model.getFacade().isAMethod(Object)

This method returns if the object is a method.

Parameters:
o - object
Returns:
true if it's a method, false if not
See Also:
Facade.isAMethod(Object)

isOperation

public boolean isOperation(Object o)
Deprecated. by Bob in 0.21.1. There is a duplicate method Model.getFacade().isAOperation(Object)

This method returns if the object is an operation.

Parameters:
o - object
Returns:
true if it's an operation, false if not
See Also:
Facade.isAOperation(Object)

getOperations

public Collection getOperations(Object classifier)
This method returns all operations of a given Classifier.

Parameters:
classifier - the classifier you want to have the operations for
Returns:
a collection of the operations

setOperations

public void setOperations(Object classifier,
                          Collection operations)
This method replaces all operations of the given classifier by the given collection of operations.

Parameters:
classifier - the given classifier
operations - the new operations

getAttributes

public Collection getAttributes(Object classifier)
This method returns all attributes of a given Classifier.

Parameters:
classifier - the classifier you want to have the attributes for
Returns:
a collection of the attributes

setAttributes

public void setAttributes(Object classifier,
                          Collection attributes)
This method replaces all attributes of the given classifier by the given collection of attributes.

Parameters:
classifier - the classifier
attributes - the new attributes

getAttributesInh

public Collection getAttributesInh(Object classifier)
This method returns all attributes of a given Classifier, including inherited.

Parameters:
classifier - the classifier you want to have the attributes for
Returns:
a collection of the attributes

getOperationsInh

public Collection getOperationsInh(Object classifier)
This method returns all operations of a given Classifier, including inherited.

Parameters:
classifier - the classifier you want to have the operations for
Returns:
a collection of the operations

getReturnParameter

public Object getReturnParameter(Object operation1)
Deprecated. by tfmorris before 0.21.1 - use getReturnParameters

This method finds all parameters of the given operation which have the ParameterDirectionType RETURN. If it is only one, it is returned. In case there are no return parameters, null is returned. If there is more than one return paramter, first of them is returned, but a message is logged.

Parameters:
operation1 - the operation you want to find the return parameter for.
Returns:
If this operation has only one paramter with Kind: RETURN, this is it, otherwise null
See Also:
getReturnParameters(Object)

getReturnParameters

public Collection getReturnParameters(Object operation)
Returns all return parameters for an operation.

Parameters:
operation - is the operation.
Returns:
Collection

getSpecification

public Object getSpecification(Object object)
Returns the operation that some method realized. Returns null if object isn't a method or, possibly, if the method isn't properly defined.

There is also a method in the Facade interface with the same name which may be what you want if you are looking for the specification of something other than a Method.

Parameters:
object - the method you want the realized operation of.
Returns:
an operation, or null.
See Also:
Facade.getSpecification(Object)

getSpecifications

public Collection getSpecifications(Object classifier)
Returns all Interfaces of which this class is a realization.

Duplicate of method by same name in Facade.

Parameters:
classifier - the class you want to have the interfaces for
Returns:
a collection of the Interfaces
See Also:
Facade.getSpecifications(Object)

getSubtypes

public Collection getSubtypes(Object cls)
This method returns all Classifiers of which this class is a direct supertype.

Parameters:
cls - the class you want to have the children for
Returns:
a collection of the children, each of which is a GeneralizableElement.

getAllBehavioralFeatures

public Collection getAllBehavioralFeatures(Object element)
Returns all behavioralfeatures found in this element and its children.

Parameters:
element - is the element
Returns:
Collection

getBehavioralFeatures

public Collection getBehavioralFeatures(Object clazz)
Returns all behavioral features of some classifier.

Parameters:
clazz - The classifier
Returns:
the collection with all behavioral features of some classifier

getAllInterfaces

public Collection getAllInterfaces(Object ns)
Returns all interfaces found in this namespace and in its children.

Parameters:
ns - the given namespace
Returns:
Collection with all interfaces found

getAllClasses

public Collection getAllClasses(Object ns)
Returns all classes found in this namespace and in its children.

Parameters:
ns - is the namespace.
Returns:
Collection

getRealizedInterfaces

public Collection getRealizedInterfaces(Object cls)
Return all interfaces the given class realizes.

Parameters:
cls - the classifier
Returns:
Collection

getExtendedClassifiers

public Collection getExtendedClassifiers(Object clazz)
Returns all classes some generalizable element extends.

Parameters:
clazz - is the generalizable element
Returns:
Collection

getGeneralization

public Object getGeneralization(Object achild,
                                Object aparent)
Gets the generalization between two generalizable elements. Returns null if there is none.

Parameters:
achild - is the child generalizable element.
aparent - is the parent generalizable element.
Returns:
MGeneralization

getBody

public String getBody(Object comment)
Gets the body of a comment.

Parameters:
comment - the comment
Returns:
the body of the comment

getFlows

public Collection getFlows(Object source,
                           Object target)
Returns all flows from some source modelelement to a target modelelement.

Parameters:
source - is the source model element.
target - is the target model element.
Returns:
Collection

getExtendingElements

public Collection getExtendingElements(Object clazz)
Returns all elements that extend some class.

Parameters:
clazz - is the class (a generalizable element)
Returns:
Collection

getExtendingClassifiers

public Collection getExtendingClassifiers(Object clazz)
Returns all classifiers that extend some classifier.

Parameters:
clazz - is the classifier.
Returns:
Collection

getAllComponents

public Collection getAllComponents(Object ns)
Returns all components found in this namespace and in its children.

Parameters:
ns - is the namespace.
Returns:
Collection

getAllDataTypes

public Collection getAllDataTypes(Object ns)
Returns all components found in this namespace and in its children.

Parameters:
ns - is the namespace
Returns:
Collection

getAllNodes

public Collection getAllNodes(Object ns)
Returns all components found in this namespace and in its children.

Parameters:
ns - is the namespace
Returns:
Collection

getAssociatedClassifiers

public Collection getAssociatedClassifiers(Object aclassifier)
Gets all classifiers that are associated to the given classifier (have an association relationship with the classifier).

Parameters:
aclassifier - an MClassifier
Returns:
Collection

getAssociations

public Collection getAssociations(Object from,
                                  Object to)
Gets the associations between the classifiers from and to. Returns null if from or to is null or if there is no association between them.

Parameters:
from - a classifier
to - a classifier
Returns:
a Collection with Associations

getAllClassifiers

public Collection getAllClassifiers(Object namespace)
Returns all classifiers found in this namespace and in its children.

Parameters:
namespace - the given namespace
Returns:
Collection the collection of all classifiers found in the namespace

getAssociations

public Collection getAssociations(Object oclassifier)
Returns all associations for some classifier.

Parameters:
oclassifier - the given classifier
Returns:
Collection all associations for the given classifier

getAssociationEnd

public Object getAssociationEnd(Object type,
                                Object assoc)
Returns the associationend between a classifier and an associaton.

Parameters:
type - is the classifier
assoc - is the association
Returns:
An AssociationEnd.

getAllContents

public Collection getAllContents(Object clazz)
Returns the contents (owned elements) of this classifier and all its parents as specified in section 2.5.3.8 of the UML 1.3 spec.

Parameters:
clazz - is the classifier
Returns:
Collection

getAllAttributes

public Collection getAllAttributes(Object clazz)
Returns all attributes of some classifier and of its parents.

Parameters:
clazz - is the classifier
Returns:
Collection

getAllVisibleElements

public Collection getAllVisibleElements(Object ns)
Returns a Set containing all ModelElements visible outside of the Namespace. This is an "Additional Operation" from the UML spec.

Parameters:
ns - the given namespace
Returns:
the collection with modelelements

getSource

public Object getSource(Object relationship)
Returns the source of a relation. The source of a relation is defined as the modelelement that propagates this relation. If there are more then 1 sources, only the first is returned. If there is no source, null is returned. Examples of sources include classifiers that are types to associationends, usecases that are bases to extend and include relations and so on. A source is allways the start from the arrow in the fig, the destination the end.

This method also works to get the source of a Link.

TODO: move this method to a generic ModelHelper

Parameters:
relationship - is the relation
Returns:
Object

getDestination

public Object getDestination(Object relationship)
Returns the destination of a relation. The destination of a relation is defined as the modelelement that receives this relation. If there are more then 1 destinations, only the first is returned. If there is no destination, null is returned. Examples of sources include classifiers that are types to associationends, usecases that are bases to extend and include relations and so on. In the case of an association, the destination is defined as the type of the second element in the connections list.

This method also works for links.

TODO: move this method to a generic ModelHelper

Parameters:
relationship - is the relation
Returns:
object

getDependencies

public Collection getDependencies(Object supplierObj,
                                  Object clientObj)
Returns the dependencies between some supplier modelelement and some client modelelement. Does not return the vica versa relationship (dependency 'from client to supplier').

Parameters:
supplierObj - a MModelElement
clientObj - a MModelElement
Returns:
Collection

getRelationships

public Collection getRelationships(Object source,
                                   Object dest)
Returns all relationships between the source and dest modelelement and vica versa.

Parameters:
source - is the source model element
dest - is the destination model element
Returns:
Collection

isValidNamespace

public boolean isValidNamespace(Object mObj,
                                Object nsObj)
Returns true if some modelelement may be owned by the given namespace.

Parameters:
mObj - a MModelElement
nsObj - a MNamespace
Returns:
boolean

getFirstSharedNamespace

public Object getFirstSharedNamespace(Object ns1,
                                      Object ns2)
Gets the first namespace two namespaces share. That is: it returns the first namespace that owns the given namespaces itself or some owner of the given namespaces.

Parameters:
ns1 - is the first name space
ns2 - is the second name space
Returns:
The Namespace.

getAllPossibleNamespaces

public Collection getAllPossibleNamespaces(Object modelElement,
                                           Object model)
Returns all possible namespaces that may be selected by some given modelelement. Which namespaces are allowed, is decided in the method isValidNamespace.

Parameters:
modelElement - is the model element
model - the model to search
Returns:
Collection

getChildren

public Collection getChildren(Object o)
Returns all children from some given generalizableelement on all levels (the complete tree excluding the generalizable element itself).

Parameters:
o - is the generalizable element
Returns:
Collection
Throws:
IllegalStateException - if there is a circular reference.

getAllRealizedInterfaces

public Collection getAllRealizedInterfaces(Object o)
Returns all interfaces that are realized by the given class or by its superclasses. It's possible that interfaces occur twice in the collection returned. In that case there is a double reference to that interface.

Parameters:
o - is the given class
Returns:
Collection

hasCompositeEnd

public boolean hasCompositeEnd(Object association)
Parameters:
association - the association to be investigated
Returns:
true if one of the association ends of the given association is of the composite kind

equalsAggregationKind

public boolean equalsAggregationKind(Object associationEnd,
                                     String kindType)
Parameters:
associationEnd - is the association end
kindType - the MAggregationKind as a string in lower case letter, eg: composite.
Returns:
true if the aggregation kinds are the same.

removeAnnotatedElement

public void removeAnnotatedElement(Object handle,
                                   Object me)
Remove the given modelelement from a given comment.

Parameters:
handle - MComment
me - MModelElement

removeClientDependency

public void removeClientDependency(Object handle,
                                   Object dep)
This method removes a dependency from a model element.

Parameters:
handle - is the model element
dep - is the dependency

removeConstraint

public void removeConstraint(Object handle,
                             Object cons)
Remove the given constraint from a given ModelElement.

Parameters:
handle - ModelElement
cons - Constraint

removeOwnedElement

public void removeOwnedElement(Object handle,
                               Object value)
Removes a owned model element from a namespace.

Parameters:
handle - is the name space
value - is the model element

removeParameter

public void removeParameter(Object handle,
                            Object parameter)
This method removes a parameter from an operation.

Parameters:
handle - The operation.
parameter - The parameter.

removeSourceFlow

public void removeSourceFlow(Object handle,
                             Object flow)
Remove a source flow from a model element.

Parameters:
handle - The model element.
flow - The flow.

removeSupplierDependency

public void removeSupplierDependency(Object supplier,
                                     Object dependency)
Adds a supplier dependency to some modelelement.

Parameters:
supplier - the supplier
dependency - the dependency

removeTaggedValue

public void removeTaggedValue(Object handle,
                              String name)
Removes a named tagged value from a model element, ie subsequent calls to getTaggedValue will return null for name, at least until a tagged value with that name has been added again.

Parameters:
handle - the model element to remove the tagged value from
name - the name of the tagged value
Throws:
IllegalArgumentException - if handle isn't a model element

removeTargetFlow

public void removeTargetFlow(Object handle,
                             Object flow)
Add a target flow to a model element.

Parameters:
handle - The model element.
flow - The flow to add.

addAnnotatedElement

public void addAnnotatedElement(Object comment,
                                Object annotatedElement)
Adds an annotated element to a comment.

Parameters:
comment - The comment to which the element is annotated
annotatedElement - The element to annotate

addClient

public void addClient(Object handle,
                      Object element)
Adds a client model element to some dependency.

Parameters:
handle - dependency.
element - The model element.
Throws:
IllegalArgumentException - if the handle is not a dependency or the element is not a model element.

addClientDependency

public void addClientDependency(Object handle,
                                Object dependency)
Adds a client dependency to some modelelement.

Parameters:
handle - the modelelement
dependency - the dependency

addComment

public void addComment(Object element,
                       Object comment)
Add a new comment to a model element.

Parameters:
element - the element to which the comment is to be added
comment - the comment for the model element

addConnection

public void addConnection(Object handle,
                          Object connection)
Add an End to a connection.

Parameters:
handle - Association or Link
connection - AssociationEnd or LinkEnd

addConstraint

public void addConstraint(Object handle,
                          Object mc)
Adds a constraint to some model element.

Parameters:
handle - model element
mc - constraint

addDeploymentLocation

public void addDeploymentLocation(Object handle,
                                  Object node)
Parameters:
handle - Component
node - Node

addFeature

public void addFeature(Object handle,
                       int index,
                       Object f)
Adds a feature to some classifier.

Parameters:
handle - classifier
index - position
f - feature

addFeature

public void addFeature(Object handle,
                       Object f)
Adds a feature to some classifier.

Parameters:
handle - classifier
f - feature

addLink

public void addLink(Object handle,
                    Object link)
Add the given Link to the given Link or Association.

Parameters:
handle - the Link or Association
link - Link

addMethod

public void addMethod(Object handle,
                      Object m)
Adds a method to some operation and copies the op's attributes to the method.

Parameters:
handle - is the operation
m - is the method

addOwnedElement

public void addOwnedElement(Object handle,
                            Object me)
Adds a model element to some namespace.

Parameters:
handle - namespace
me - model element

addParameter

public void addParameter(Object handle,
                         int index,
                         Object parameter)
Add a Parameter to the given object at given location.

Parameters:
handle - The object that will get the Parameter: MEvent, MBehavioralFeature.
index - the location
parameter - Object that will be added

addParameter

public void addParameter(Object handle,
                         Object parameter)
Add a Parameter to the given object.

Parameters:
handle - The object that will get the Parameter: MObjectFlowState, MEvent, MBehavioralFeature, MClassifier.
parameter - Object that will be added

addRaisedSignal

public void addRaisedSignal(Object handle,
                            Object sig)
Add a raised Signal to a Message or Operation.

Parameters:
handle - the Message or Operation
sig - the Signal that is raised

addSourceFlow

public void addSourceFlow(Object handle,
                          Object flow)
Add a source flow to a model element.

Parameters:
handle - The model element.
flow - The flow.

addSupplier

public void addSupplier(Object handle,
                        Object element)
Adds a supplier classifier to some abstraction.

Parameters:
handle - abstraction
element - supplier model element

addSupplierDependency

public void addSupplierDependency(Object supplier,
                                  Object dependency)
Adds a supplier dependency to some modelelement.

Parameters:
supplier - the supplier
dependency - the dependency

addTaggedValue

public void addTaggedValue(Object handle,
                           Object taggedValue)
Adds a TaggedValue to a ModelElement.

Parameters:
handle - ModelElement
taggedValue - TaggedValue

addTargetFlow

public void addTargetFlow(Object handle,
                          Object flow)
Add a target flow to a model element.

Parameters:
handle - The model element.
flow - The flow to add.

setAbstract

public void setAbstract(Object handle,
                        boolean flag)
Sets if of some model element is abstract.

Parameters:
handle - is the classifier
flag - is true if it should be abstract

setActive

public void setActive(Object handle,
                      boolean active)
Makes a Class active.

Parameters:
handle - Class
active - boolean

setAggregation

public void setAggregation(Object handle,
                           Object aggregationKind)
Sets the aggregation of some model element.

Parameters:
handle - the model element to set aggregation
aggregationKind - the aggregation kind

setAnnotatedElements

public void setAnnotatedElements(Object handle,
                                 Collection elems)
Sets the list of annotated elements of the given comment.

Parameters:
handle - the given comment
elems - the list of annotated modelelements

setAssociation

public void setAssociation(Object handle,
                           Object association)
Sets the association of some model element.

Parameters:
handle - the model element to set association
association - is the association

setLeaf

public void setLeaf(Object handle,
                    boolean flag)
Sets if some model element is a leaf.

Parameters:
handle - model element
flag - is true if it is a leaf.

setRaisedSignals

public void setRaisedSignals(Object handle,
                             Collection raisedSignals)
Sets the raised signals of some behavioural feature.

Parameters:
handle - the behavioural feature
raisedSignals - the raised signals

setBody

public void setBody(Object handle,
                    Object expr)
Sets a body of a given Method or Constraint.

Parameters:
handle - The method or constraint.
expr - The body of the expression. If it is a method, this must be a ProcedureExpression. If it is a Constraint, this must be a BooleanExpression.

setChangeability

public void setChangeability(Object handle,
                             Object ck)
Set the Changeability of a StructuralFeature or AssociationEnd.

Parameters:
handle - StructuralFeature or AssociationEnd
ck - ChangeableKind

setChangeable

public void setChangeable(Object handle,
                          boolean flag)
Set the changeability of some feature.

Parameters:
handle - is the feature
flag - is the changeability flag

setChild

public void setChild(Object handle,
                     Object child)
Set the child for a generalization.

Parameters:
handle - Generalization
child - GeneralizableElement

setConcurrency

public void setConcurrency(Object handle,
                           Object concurrencyKind)
Set the concurrency of some operation.

Parameters:
handle - is the operation
concurrencyKind - is the concurrency

setConnections

public void setConnections(Object handle,
                           Collection elems)
Sets the list of connections of the given association or link.

Parameters:
handle - the given association or link
elems - the list of association-ends or link-ends

setDefaultValue

public void setDefaultValue(Object handle,
                            Object expr)
Sets a default value of some parameter.

Parameters:
handle - is the parameter
expr - is the expression

setDiscriminator

public void setDiscriminator(Object handle,
                             String discriminator)
Parameters:
handle - a generalization
discriminator - the discriminator to set

setFeature

public void setFeature(Object elem,
                       int i,
                       Object impl)
Set the feature at the given position.

Parameters:
elem - The classifier to set.
i - The position. Start with 0.
impl - The feature to set.

setFeatures

public void setFeatures(Object handle,
                        Collection features)
Sets the features of some model element.

Parameters:
handle - the model element to set features to
features - the list of features

setImplementationLocation

public void setImplementationLocation(Object handle,
                                      Object component)
Deprecated. by tfmorris before 0.20 - use setContainer

Set the ImplementationLocation of the given ElementResidence to the given Component.

Parameters:
handle - the ElementResidence
component - the Component
See Also:
setContainer(Object, Object)

setContainer

public void setContainer(Object handle,
                         Object component)
Set the Container of the given ElementResidence to the given Component.

Parameters:
handle - the ElementResidence
component - the Component

setInitialValue

public void setInitialValue(Object at,
                            Object expr)
Sets an initial value.

Parameters:
at - attribute that we set the initial value of
expr - that is the value to set. Can be null.

setKind

public void setKind(Object handle,
                    Object kind)
Set some parameters kind.

Parameters:
handle - is the parameter
kind - is the directionkind

setKindToIn

public void setKindToIn(Object handle)
Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)

Set some parameters kind to 'in'.

Parameters:
handle - is the parameter

setKindToInOut

public void setKindToInOut(Object handle)
Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)

Set some parameters kind to 'in/out'.

Parameters:
handle - is the parameter

setKindToOut

public void setKindToOut(Object handle)
Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)

Set some parameters kind to 'out'.

Parameters:
handle - is the parameter

setKindToReturn

public void setKindToReturn(Object handle)
Deprecated. before 0.19.3 by bobtarling - use setKind(Object, Object)

Set some parameters kind to 'return'.

Parameters:
handle - is the parameter

setModelElementContainer

public void setModelElementContainer(Object handle,
                                     Object container)
Sets the container that owns the handle.

Warning: the implementation does not support setting the owner of actions. Use setState1 etc. on action for that goal.

Use a more specific method such as setOwner, setContainer, etc if at all possible, rather than this method.

Parameters:
handle - The modelelement that must be added to the container
container - The owning modelelement
Throws:
IllegalArgumentException - when the handle or container is null or if the handle cannot be added to the container.

setMultiplicity

public void setMultiplicity(Object handle,
                            Object arg)
Sets a multiplicity of some model element.

Parameters:
handle - model element
arg - multiplicity as string OR multiplicity object

setName

public void setName(Object handle,
                    String name)
Sets a name of some modelelement.

Parameters:
handle - is the model element
name - to set

setBody

public void setBody(Object handle,
                    String body)
Sets the body of a comment.

NOTE: For UML 1.3, this actually set Comment.name, but for UML 1.4 it sets Comment.body. This is a behavior change in the API.

Parameters:
handle - the Comment element
body - the string

setNamespace

public void setNamespace(Object handle,
                         Object ns)
Sets a namespace of some modelelement.

Parameters:
handle - is the model element
ns - is the namespace. Can be null.

setNavigable

public void setNavigable(Object handle,
                         boolean flag)
Sets the navigability of some association end.

Parameters:
handle - is the association end
flag - is the navigability flag

setOrdering

public void setOrdering(Object handle,
                        Object ok)
Set the OrderingKind of a given AssociationEnd.

Parameters:
handle - AssociationEnd
ok - OrderingKind

setOwner

public void setOwner(Object handle,
                     Object owner)
Set the owner of a Feature.

Parameters:
handle - Feature
owner - Classifier or null

setOwnerScope

public void setOwnerScope(Object handle,
                          Object os)
Parameters:
handle - Feature
os - ScopeKind

setParameters

public void setParameters(Object handle,
                          Collection parameters)
Sets the parameters of a classifier, event, objectflowstate or behavioralfeature.

Parameters:
handle - the classifier, event, objectflowstate or behavioralfeature
parameters - is a Collection of parameters

setParent

public void setParent(Object handle,
                      Object parent)
Sets the parent of a generalization.

Parameters:
handle - generalization
parent - generalizable element (parent)

setPowertype

public void setPowertype(Object handle,
                         Object pt)
Set the PowerType of a Generalization.

Parameters:
handle - Generalization
pt - Classifier

setQualifiers

public void setQualifiers(Object handle,
                          Collection elems)
Sets the qualified attributes of an association end.

Parameters:
handle - the association end
elems - is a Collection of qualifiers

setQuery

public void setQuery(Object handle,
                     boolean flag)
Sets the query flag of a behavioral feature.

Parameters:
handle - is the behavioral feature
flag - is the query flag

setResident

public void setResident(Object handle,
                        Object resident)
Parameters:
handle - ElementResidence
resident - ModelElement or null

setResidents

public void setResidents(Object handle,
                         Collection residents)
Sets the residents of some model element.

Parameters:
handle - the model element
residents - collection

setRoot

public void setRoot(Object handle,
                    boolean flag)
Sets if some model element is a root.

Parameters:
handle - model element
flag - is true if it is a root

setSources

public void setSources(Object handle,
                       Collection specifications)
Parameters:
handle - Flow
specifications - the collection of ModelEvents (sourceFlow)

setSpecification

public void setSpecification(Object handle,
                             boolean specification)
Set the Specification flag for a ModelElement.

Parameters:
handle - ModelElement
specification - boolean

setSpecification

public void setSpecification(Object method,
                             Object specification)
Set the specification (i.e. the operation) of a Method.

Parameters:
method - the method
specification - the operation

setSpecification

public void setSpecification(Object operation,
                             String specification)
Set the specification of an Operation.

Parameters:
operation - the operation
specification - the operation

setSpecifications

public void setSpecifications(Object handle,
                              Collection specifications)
Sets the specifications of some association end.

Parameters:
handle - the association end
specifications - collection

addStereotype

public void addStereotype(Object modelElement,
                          Object stereo)
Adds a stereotype to some modelelement.

Parameters:
modelElement - model element
stereo - stereotype

addAllStereotypes

public void addAllStereotypes(Object modelElement,
                              Collection stereos)
Adds a collection of stereotype to some modelelement.

Parameters:
modelElement - model element
stereos - stereotype

removeStereotype

public void removeStereotype(Object handle,
                             Object stereo)
Removes a stereotype from some modelelement.

Parameters:
handle - model element
stereo - stereotype

clearStereotypes

public void clearStereotypes(Object handle)
Removes all stereotypes from a given modelelement.

Parameters:
handle - model element

setTaggedValue

public void setTaggedValue(Object handle,
                           String tag,
                           String value)
Sets a tagged value of some modelelement.

Parameters:
handle - is the model element
tag - is the tag name (a string)
value - is the value

setTaggedValues

public void setTaggedValues(Object handle,
                            Collection taggedValues)
Set the TaggedValues of a ModelElement.

Parameters:
handle - ModelElement
taggedValues - Collection of TaggedValues

setTargetScope

public void setTargetScope(Object handle,
                           Object scopeKind)
Set the target scope of some association end or structural feature.

Parameters:
handle - the model element
scopeKind - the target scope

setType

public void setType(Object handle,
                    Object type)
Sets the type of some parameter.

Parameters:
handle - is the model element
type - is the type (a classifier)

setUUID

public void setUUID(Object handle,
                    String uuid)
Deprecated. by tfm for 0.20 - getUUID is guaranteed to return a value but it is not settable. If a settable ID is required, use a TaggedValued or other private mechanism.

Set the UUID of this element.

Parameters:
handle - base element (MBase type)
uuid - is the UUID

setVisibility

public void setVisibility(Object handle,
                          Object visibility)
Set the visibility of some modelelement.

Parameters:
handle - element
visibility - is the visibility

removeDeploymentLocation

public void removeDeploymentLocation(Object handle,
                                     Object node)
Remove a deployment location.

Parameters:
handle - Component from which to remove deploymentLocation
node - Node to be removed

removeConnection

public void removeConnection(Object handle,
                             Object connection)
Remove a connection between an Association & AssociationEnd or between a Link & LinkEnd.

Parameters:
handle - Association or Link
connection - AssociationEnd or LinkEnd

addElementResidence

public void addElementResidence(Object handle,
                                Object residence)
Add an ElementResidence.

Parameters:
handle - ModelElement
residence - ElementResidence to add

removeElementResidence

public void removeElementResidence(Object handle,
                                   Object residence)
Remove an ElementResidence.

Parameters:
handle - ModelElement
residence - ElementResidence to remove

setEnumerationLiterals

public void setEnumerationLiterals(Object enumeration,
                                   List literals)
Set the (ordered) list of literals of an Enumeration.

Parameters:
enumeration - Enumeration to add EnumerationLiterals too
literals - A list of EnumerationLiterals

getAllMetatypeNames

public Collection getAllMetatypeNames()
Returns names of all metatypes in metamodel TODO: This method rightly belongs in a separate interface dealing with instances of MOF types as opposed to UML types like all the rest of the methods here do.

Returns:
Collection containing Strings with names of all metatypes


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook