Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement Class Reference

Abstract implementation for aXLang elements. More...

List of all members.

Public Member Functions

 AbstractAXLangElement ()
 Constructor, sets model and parent, creates stores.
void addChild (IAXLangElement newChild, Role theRole) throws AXLException
 Adds the given child.
void addElement (IAXLangElement newElement, ReferenceKind theKind, Role theRole) throws AXLException
 Adds the given element with its kind and role.
void addReference (IAXLangElement theReferencedElement, Role theRole) throws AXLException
 Adds the given reference.
void addValidElementType (ReferenceKind theKind, ValidType theValidType)
 adds a valid element type
void cleanAfterClone ()
 Performs cleaning steps after a clone operation.
IAXLangElement clone ()
 Makes a deep copy of the element w.r.t. the parent-children hierarchy; references are only copied if the referenced element is an predecessor of the cloned element.
int compareTo (IAXLangElement axlOther)
 Define sorting order.
void delete ()
 deletes the element from the model
boolean detachChild (IAXLangElement child, Role role)
boolean detachFromParent (Role role)
boolean equals (Object other)
 Defines equality.
boolean equals (Object other, boolean isNamespaceDependent)
 Defines equality with special flags.
IAXLangElement getChild (String sIdentifier)
 Returns the child with the given identifier.
IAXLangElement getChild (Role theRole)
 Returns the first child with the given role.
Map< Role, Collection
< IAXLangElement > > 
getChildren ()
 Returns a map of the direct children of the element.
Collection<?extends
IAXLangElement
getChildren (Role theRole)
 Returns an ordered collection of the direct children of the element with the given role.
String getClassName ()
 Returns the class name of this element.
IAXLangElement getClone ()
 Returns the elements clone.
Map< Role, Collection
< IAXLangElement > > 
getDescendants ()
 Returns a map of the descendants (children, children's children, etc.) of the element.
Collection< IAXLangElementgetDescendants (Role theRole)
 Returns a collection of the descendants (children, children's children, etc.) of the element with the given role.
IAXLangElement getElement (ReferenceKind theKind, String sIdentifier)
 Returns the (first) element with the given role and identifier.
IAXLangElement getElement (ReferenceKind theKind, Role theRole)
 Returns the (first) element with the given kind and role.
IAXLangElement getElement (ReferenceKind theKind, List< String > lstIdentifiers)
 Returns the element described by the list of identifiers.
Map< ReferenceKind, Map< Role,
Collection< IAXLangElement > > > 
getElements ()
 Returns the elements of the element.
Collection< IAXLangElementgetElements (ReferenceKind theKind, Role theRole)
 Returns an ordered collection of the elements of the element with the given kind and role.
Map< Role, Collection
< IAXLangElement > > 
getElements (ReferenceKind theKind)
 Returns a map of the elements of the element.
MetaInformation getMetaInformation ()
 Returns the meta information.
Model getModel ()
 Returns the aXLang model.
Collection< ElementWithMessagegetNonValidElements ()
 Computes the non-valid elements beginning from and including this element to it's children, children's children etc.
IAXLangElement getOrigin ()
 Returns the elements origin.
IAXLangElement getParent ()
 Returns the parent element.
IAXLangElement getReference (Role theRole)
 Returns the (first) reference with the given role.
Map< Role, Collection
< IAXLangElement > > 
getReferences ()
 Returns a map of the references of the element.
Collection<?extends
IAXLangElement
getReferences (Role theRole)
 Returns an ordered collection of the references of the element with the given role.
Collection< IAXLangElementgetReferencingElements (Role theRole)
 Returns all elements referencing this element with the given role.
Map< Role, Collection
< IAXLangElement > > 
getReferencingElements ()
 Returns all elements referencing this element with their role.
Collection< IAXLangElementgetTheChildren ()
 Returns an ordered collection of the direct children of the element.
String getUID ()
 Returns UID for the element.
String getUnusedChildName (String thePlannedName, String theSuffix)
 Returns a new unused name for the child, usind the given name and adding suffixes as often as needed.
String getUUID ()
 Returns UUID for the element.
Collection< ValidTypegetValidElementTypes (ReferenceKind theKind)
 Returns the collection of valid element types.
int hashCode (boolean isNamespaceDependent)
 Yields a hashCode with special flags.
int hashCode ()
 Yields a hashCode.
boolean isCalculated ()
boolean isComposite ()
 Is the element a composite in the hierarchy (e.g. a "normal" feature group, composite component) or not? Implementation of the default behavior, has to be overwritten if necessary.
boolean isLeaf ()
 Is the element a leaf in the hierarchy (e.g. leaf feature, atomic component) or not? Implementation of the default behavior, has to be overwritten if necessary.
boolean isNecessary (IAXLangElement axlElement)
 checks whether an element is necessary according to the cardinality of its reference kind and role
boolean isValid ()
 Returns if the element is valid.
boolean removeChild (IAXLangElement oldElement, Role theRole)
 Removes the given child from this element.
boolean removeElement (IAXLangElement oldElement, ReferenceKind theKind, Role theRole)
 Removes the given element from this element.
boolean removeElement (IAXLangElement oldElement, ReferenceKind theKind)
 Removes the given element from this element (role will be guessed).
boolean removeFromElementMap (ReferenceKind referenceKind, Role role, IAXLangElement element)
 removes an element from the elements map
boolean removeReference (IAXLangElement oldElement, Role theRole)
 Removes the given reference from this element.
void replaceBy (IAXLangElement theReplacement)
 Replaces this element by the given replacement.
void setCalculated (boolean calculated)
void setMetaInformation (MetaInformation newMetaInformation)
 sets the meta information
void setOrigin (IAXLangElement newOrigin)
 Sets the elements origin.
void setUUID (String newUUID)
 Sets UUID for the element.
void setValidElementTypes (ReferenceKind theKind, ValidType...theTypes)
 Sets the valid element types.
String toString ()
 Returns a string representation of the element.

Private Member Functions

void cleanClonedElements ()
 Cleans the cloned elements.
IAXLangElement cloneChildren ()
 Creates the clone and clones its children recursively.
void cloneReferences (ReferenceKind theReferenceKind, IAXLangElement axlRoot)
 Adds those references to a clone that are descendants of the clone.
void initElement ()
 Initialization of the element.
void removeCloneInformation ()
 Removes the clone information (clone).

Private Attributes

IAXLangElement axlParent = null
 parent element
boolean isCalculated = false
 a calculated element
IAXLangElement itsClone
 cloned element, if this element was cloned
IAXLangElement itsOrigin
 originating element, if this element is a clone
Map< ReferenceKind, Map< Role,
Collection< IAXLangElement > > > 
mapElements = null
 map of the elements (children and references)
MetaInformation theMetaInformation = null
 meta information
String theUuid = null
 uuid of the element.

Static Private Attributes

static Map< Class<?extends
IAXLangElement >, Map
< ReferenceKind, Collection
< ValidType > > > 
mapValidElementTypes = null
 map of valid element types

Detailed Description

Abstract implementation for aXLang elements.

This abstract class defines the methods and attributes of every aXLang element.

Remarks:
this class has a natural ordering that is inconsistent with equals.

For information on the stored elements, please refer to the interface IAXLangElement.

Author:
ekleinod
nschult
mgrosse
skaegebein
smann
cknoppek
Version:
0.9.0
Since:
0.1

Constructor & Destructor Documentation

de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.AbstractAXLangElement (  ) 

Constructor, sets model and parent, creates stores.


Member Function Documentation

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.addChild ( IAXLangElement  newChild,
Role  theRole 
) throws AXLException

Adds the given child.

Parameters:
newChild child to be added
theRole role of the child
Exceptions:
AXLException if child could not be added

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.addElement ( IAXLangElement  newElement,
ReferenceKind  theKind,
Role  theRole 
) throws AXLException

Adds the given element with its kind and role.

not allowed:

  • null elements
  • ...

allowed:

  • elements that exceed the allowed cardinality
Parameters:
newElement element to be added
theKind kind of the element
theRole role of the element
Exceptions:
AXLException if element could not be added

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.XORComponent.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.addReference ( IAXLangElement  theReferencedElement,
Role  theRole 
) throws AXLException

Adds the given reference.

Parameters:
theReferencedElement reference to be added
theRole role
Exceptions:
AXLException if reference could not be added

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.addValidElementType ( ReferenceKind  theKind,
ValidType  theValidType 
)

adds a valid element type

Parameters:
theKind the kind: child, reference, or path
theValidType the new type
void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.cleanAfterClone (  ) 

Performs cleaning steps after a clone operation.

Normally, this operation does nothing, it is needed for special elements, such as de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.XORComponent.

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.cleanClonedElements (  )  [private]

Cleans the cloned elements.

Calls cleaning methods recursively at all childs.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.clone (  ) 

Makes a deep copy of the element w.r.t. the parent-children hierarchy; references are only copied if the referenced element is an predecessor of the cloned element.

This means, if a reference points to an element outside of the cloned element, this reference is cut from the model.

  1. create clone and copy its children
  2. update references
  3. update paths
  4. remove clone information (links from this element to its clone)
Returns:
clone of the element

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.utilities.ElementPath.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.cloneChildren (  )  [private]

Creates the clone and clones its children recursively.

Returns:
clone of the element
void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.cloneReferences ( ReferenceKind  theReferenceKind,
IAXLangElement  axlRoot 
) [private]

Adds those references to a clone that are descendants of the clone.

  • if the calling element is not a clone nothing happens
  • process all references
  • recurse through all children of the clone
Parameters:
theReferenceKind kind of reference to clone
axlRoot root cloned element
int de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.compareTo ( IAXLangElement  axlOther  ) 

Define sorting order.

Default sorting order (smaller elements first):

  1. no identifier
  2. comparison of identifier This sorting order is not consistent with equals() since only the identifiers are considered. Elements with equal identifiers always yield comparesTo() == 0, although equals() may yield false.
Parameters:
axlOther other element
Returns:
result of comparison
Return values:
<0 this element is less than the other
0 this element equals the other
>0 this element is greater than the other

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.AbstractConnection, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Component, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.DataElement, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Port, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.RWAccess, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Storage, and de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.SubComponent.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.delete (  ) 

deletes the element from the model

Deletion is obtained by informing all listeners that this element shall not be referenced as child, reference, or path any longer.

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.detachChild ( IAXLangElement  child,
Role  role 
)
boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.detachFromParent ( Role  role  ) 
boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.equals ( Object  other  ) 

Defines equality.

Elements are equal if:

  1. they are the same object (==)
  2. and
    1. their namespaces are equal
    2. their attributes are equal
      1. if the identifier is not generated, the identifiers have to be equal too
    3. their elements are equal
Parameters:
other other object
Returns:
are the objects equal?
Return values:
true objects are equal
false objects are not equal

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.utilities.ElementPath, and de.fraunhofer.isst.axbench.operations.checker.utilities.DataFlowElement.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.equals ( Object  other,
boolean  isNamespaceDependent 
)

Defines equality with special flags.

This method is needed in order to encapsulate the different equality types. Therefore this method has arguments in order to implement different equality types, the java equal method has to be overwritten only if a different equals method is needed, but most of the code can be reused.

The switches are:

  • switch on/off namespace identity

Every switch has to be considered in hashCode() too.

Parameters:
other other object
isNamespaceDependent defines if the namespace has to be considered (true) or not (false)
Returns:
are the objects equal?
Return values:
true objects are equal
false objects are not equal

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getChild ( String  sIdentifier  ) 

Returns the child with the given identifier.

Parameters:
sIdentifier identifier of the child
Returns:
child with the given identifier
Return values:
null no child with the identifier exists

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getChild ( Role  theRole  ) 

Returns the first child with the given role.

Parameters:
theRole role of the child
Returns:
child with the given role
Return values:
null no child with the role exists

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Map<Role, Collection<IAXLangElement> > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getChildren (  ) 

Returns a map of the direct children of the element.

Returns:
direct children of the element
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<? extends IAXLangElement> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getChildren ( Role  theRole  ) 

Returns an ordered collection of the direct children of the element with the given role.

Parameters:
theRole role of the children
Returns:
direct children of the element (ordered collection)
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

String de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getClassName (  ) 

Returns the class name of this element.

Returns:
class name

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getClone (  ) 

Returns the elements clone.

The clone is set only if the element was cloned, during the cloning process.

Returns:
clone of the element
Return values:
null if the element was not cloned, or out of cloning process

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.featuremodel.Feature.

Map<Role, Collection<IAXLangElement> > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getDescendants (  ) 

Returns a map of the descendants (children, children's children, etc.) of the element.

Returns:
descendants of the element
Return values:
empty map if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<IAXLangElement> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getDescendants ( Role  theRole  ) 

Returns a collection of the descendants (children, children's children, etc.) of the element with the given role.

Parameters:
theRole role of the children
Returns:
descendants of the element with the given role
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getElement ( ReferenceKind  theKind,
String  sIdentifier 
)

Returns the (first) element with the given role and identifier.

If two elements with the same identifier exist, the first one found will be returned.

Parameters:
theKind kind of the element
sIdentifier identifier of the element
Returns:
element with the given identifier
Return values:
null no element with the identifier exists

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getElement ( ReferenceKind  theKind,
Role  theRole 
)

Returns the (first) element with the given kind and role.

If two elements with the same role exist, the first one found will be returned.

Parameters:
theKind kind of the element
theRole role of the element
Returns:
found element with the role
Return values:
null no element with this role found

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getElement ( ReferenceKind  theKind,
List< String >  lstIdentifiers 
)

Returns the element described by the list of identifiers.

  • get the element with the first identifier
    • if the element is null, an error occurred
  • if there is a tail, recurse
Parameters:
theKind kind of the element
lstIdentifiers list of identifiers of the element
Returns:
element with the given list of identifiers
Return values:
null no such element exists

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Map<ReferenceKind, Map<Role, Collection<IAXLangElement> > > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getElements (  ) 

Returns the elements of the element.

Returns:
elements of the element
Return values:
empty map if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Map<Role, Collection<IAXLangElement> > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getElements ( ReferenceKind  theKind  ) 

Returns a map of the elements of the element.

Parameters:
theKind kind of the element
Returns:
elements of the element
Return values:
empty map if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<IAXLangElement> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getElements ( ReferenceKind  theKind,
Role  theRole 
)

Returns an ordered collection of the elements of the element with the given kind and role.

Parameters:
theKind kind of the element
theRole role of the element
Returns:
direct elements of the element (ordered collection)
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

MetaInformation de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getMetaInformation (  ) 

Returns the meta information.

Returns:
meta information

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.operations.checker.solver.utilities.AxlElementPath.

Model de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getModel (  ) 

Returns the aXLang model.

Returns:
aXLang model
Return values:
null if no model is set

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<ElementWithMessage> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getNonValidElements (  ) 

Computes the non-valid elements beginning from and including this element to it's children, children's children etc.

An element is valid if it is valid itself and all it's children are valid as well.

  1. check if mandatory attributes are set
  2. check if all needed elements are stored with the right cardinality
  3. check if stored elements are of the right type
  4. check all children recursively
Returns:
list of non-valid elements with their errors
Return values:
empty list of element is valid

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.AbstractArchitectureModel, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.AbstractDataLink, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Component, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Connection, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Function, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Port, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.PortRWAccess, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.SubComponent, de.fraunhofer.isst.axbench.axlang.elements.aspects.AspectComposition, and de.fraunhofer.isst.axbench.axlang.elements.featuremodel.Feature.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getOrigin (  ) 

Returns the elements origin.

The origin is the element, from which this element was cloned, if the element was cloned.

Returns:
origin of the element
Return values:
null if the element was not cloned

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.featuremodel.Feature.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getParent (  ) 

Returns the parent element.

Returns:
parent element
Return values:
null if no parent element is set

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.operations.checker.solver.utilities.AxlElementPath.

IAXLangElement de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getReference ( Role  theRole  ) 

Returns the (first) reference with the given role.

If two references with the same role exist, the first one found will be returned.

Parameters:
theRole role of the reference
Returns:
found reference with the role
Return values:
null no reference with this role found

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Map<Role, Collection<IAXLangElement> > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getReferences (  ) 

Returns a map of the references of the element.

Returns:
references of the element
Return values:
empty map if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<? extends IAXLangElement> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getReferences ( Role  theRole  ) 

Returns an ordered collection of the references of the element with the given role.

Parameters:
theRole role of the references
Returns:
references of the element (ordered collection)
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<IAXLangElement> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getReferencingElements ( Role  theRole  ) 

Returns all elements referencing this element with the given role.

Parameters:
theRole role of referencing elements
Returns:
elements referencing this element with the given role

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Map<Role, Collection<IAXLangElement> > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getReferencingElements (  ) 

Returns all elements referencing this element with their role.

Returns:
elements referencing this element with their role

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<IAXLangElement> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getTheChildren (  ) 

Returns an ordered collection of the direct children of the element.

Returns:
direct children of the element (ordered collection)
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

String de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getUID (  ) 

Returns UID for the element.

The UID is a unique id for the element, per default generated from it's identifier and it's parent's identifier.

Returns:
UID of the element.

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.operations.checker.solver.utilities.AxlElementPath.

String de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getUnusedChildName ( String  thePlannedName,
String  theSuffix 
)

Returns a new unused name for the child, usind the given name and adding suffixes as often as needed.

Parameters:
thePlannedName planned name
theSuffix suffix
Returns:
new unused name

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

String de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getUUID (  ) 

Returns UUID for the element.

The UUID is a unique id for the element throughout it's whole life, including storing and reading operations.

Returns:
UUID of the element.

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Collection<ValidType> de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.getValidElementTypes ( ReferenceKind  theKind  ) 

Returns the collection of valid element types.

Parameters:
theKind kind of referenced element
Returns:
valid element types
Return values:
empty collection if there are none

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

int de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.hashCode ( boolean  isNamespaceDependent  ) 

Yields a hashCode with special flags.

This method is needed in order to encapsulate the different hashcode types. Therefore this method has arguments in order to implement different hashcode types, the java equal method has to be overwritten only if a different hashcode method is needed, but most of the code can be reused.

The switches are:

  • switch on/off namespace identity

Every switch has to be considered in equals too.

Parameters:
isNamespaceDependent defines if the namespace has to be considered (true) or not (false)
Returns:
hashCode

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

int de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.hashCode (  ) 

Yields a hashCode.

In order to be consistent with equals() the following parts of an element are used for the computation of the hashCode:

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.utilities.ElementPath, and de.fraunhofer.isst.axbench.operations.checker.utilities.DataFlowElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.initElement (  )  [private]

Initialization of the element.

Creates empty meta information and element stores.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.isComposite (  ) 

Is the element a composite in the hierarchy (e.g. a "normal" feature group, composite component) or not? Implementation of the default behavior, has to be overwritten if necessary.

Returns:
is composite?
Return values:
true is composite
false is not composite
false if not applicable

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Component, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.SubComponent, de.fraunhofer.isst.axbench.axlang.elements.featuremodel.AbstractFeature, and de.fraunhofer.isst.axbench.operations.checker.solver.utilities.AxlElementPath.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.isLeaf (  ) 

Is the element a leaf in the hierarchy (e.g. leaf feature, atomic component) or not? Implementation of the default behavior, has to be overwritten if necessary.

Returns:
is leaf?
Return values:
true is leaf
false is not leaf
false if not applicable

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.Component, de.fraunhofer.isst.axbench.axlang.elements.architecturemodel.SubComponent, de.fraunhofer.isst.axbench.axlang.elements.featuremodel.AbstractFeature, and de.fraunhofer.isst.axbench.operations.checker.solver.utilities.AxlElementPath.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.isNecessary ( IAXLangElement  axlElement  ) 

checks whether an element is necessary according to the cardinality of its reference kind and role

Parameters:
axlElement the element in question
Returns:
true if the minimum number of elements of this kind in this role is reached, else false

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.statements.Assignment.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.isValid (  ) 

Returns if the element is valid.

The implementation relies on getNonValidElements()

Returns:
validity of the element
Return values:
true the element is valid
false the element is not valid

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.removeChild ( IAXLangElement  oldElement,
Role  theRole 
)

Removes the given child from this element.

Parameters:
oldElement child to be removed
theRole role of the element
Returns:
remove success
Return values:
true child was removed, or child was null
false child was not removed, or given element was null, or given element was no child

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.removeCloneInformation (  )  [private]

Removes the clone information (clone).

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.removeElement ( IAXLangElement  oldElement,
ReferenceKind  theKind 
)

Removes the given element from this element (role will be guessed).

The first role, the element is stored under, will be taken for role.

Parameters:
oldElement element to be removed
theKind kind of the element
Returns:
remove success
Return values:
true element was removed or element was null
false element was not removed

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.removeElement ( IAXLangElement  oldElement,
ReferenceKind  theKind,
Role  theRole 
)

Removes the given element from this element.

Removing elements works recursively as follows:

  1. old child is removed from the list of children
  2. the parent element is removed from the listener list of the child
  3. the references of the child are removed
  4. the children of the child are removed
  5. the child notifies its listeners of the removal
    1. the listeners are removed as well, if the minimum number of references of the type of the removed element is not matched anymore
Parameters:
oldElement element to be removed
theKind kind of the element
theRole role of the element
Returns:
remove success
Return values:
true element was removed or element was null
false element was not removed

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.removeFromElementMap ( ReferenceKind  referenceKind,
Role  role,
IAXLangElement  element 
)

removes an element from the elements map

Parameters:
referenceKind the kind in which the element is referenced (child, reference, or path)
role the role the element plays
element the element that shall be removed
Returns:
true if the element belonged in the given reference kind and role to this element, ie. removal was successful, else false

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

boolean de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.removeReference ( IAXLangElement  oldElement,
Role  theRole 
)

Removes the given reference from this element.

Parameters:
oldElement reference to be removed
theRole role of the reference
Returns:
remove success
Return values:
true reference was removed, or reference was null
false reference was not removed

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.replaceBy ( IAXLangElement  theReplacement  ) 

Replaces this element by the given replacement.

Parameters:
theReplacement replacement for this element

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.setCalculated ( boolean  calculated  ) 
Parameters:
calculated the calculated to set

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.setMetaInformation ( MetaInformation  newMetaInformation  ) 

sets the meta information

Parameters:
newMetaInformation the new meta information
void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.setOrigin ( IAXLangElement  newOrigin  ) 

Sets the elements origin.

Usually the origin is only set within the clone method, and denotes the element from which the present element has been cloned. The setOrigin method is used by the Configurator, for instance, who creates a copy of an xor-component without using the clone method.

Parameters:
newOrigin the new origin element

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.setUUID ( String  newUUID  ) 

Sets UUID for the element.

The UID is a unique id for the element throughout it's whole life, including storing and reading operations.

Parameters:
newUUID new UUID for the element

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

void de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.setValidElementTypes ( ReferenceKind  theKind,
ValidType...  theTypes 
)

Sets the valid element types.

Parameters:
theKind kind of referenced element
theTypes valid element types

Implements de.fraunhofer.isst.axbench.axlang.api.IAXLangElement.

String de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.toString (  ) 

Returns a string representation of the element.

Returns:
string representation
Author:
ekleinod
Version:
0.9.0
Since:
0.1

Reimplemented in de.fraunhofer.isst.axbench.axlang.elements.aspects.AspectRelation, de.fraunhofer.isst.axbench.axlang.utilities.ElementPath, and de.fraunhofer.isst.axbench.operations.checker.utilities.DataFlowElement.


Member Data Documentation

parent element

a calculated element

cloned element, if this element was cloned

originating element, if this element is a clone

Map<ReferenceKind, Map<Role, Collection<IAXLangElement> > > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.mapElements = null [private]

map of the elements (children and references)

Map<Class<? extends IAXLangElement>, Map<ReferenceKind, Collection<ValidType> > > de.fraunhofer.isst.axbench.axlang.api.AbstractAXLangElement.mapValidElementTypes = null [static, private]

map of valid element types

meta information

uuid of the element.

The UUID is a unique id for the element throughout it's whole life, including storing and reading operations.

Author:
ekleinod
skaegebein
Since:
0.9.0