agg.attribute.facade
Interface TransformationFacade

All Known Implementing Classes:
DefaultTransformationFacade

public interface TransformationFacade


Method Summary
 void apply(AttrInstance workGraphInst, AttrInstance rightSideInst, AttrContext context)
          Applying a rule; the substitutions occur "in-place" (in the recipient); In Graph Transformation, this method is applied to attributes of host graph objects, "rightSide" being an attribute of the right side of the rule and "context" being the "match"-context built up by subsequently matching the attributes of corresponding graphical objects.
 void checkIfReadyToMatch(AttrContext ruleContext)
          Checking if matching can be performed with respect to a given rule context.
 void checkIfReadyToTransform(AttrContext matchContext)
          Checking if a transformation can be performed with the attributes with respect to a given context.
 AttrManager getAttrManager()
          Returns the default attribute manager which can be used for advanced operations not provided by this facade.
 AttrContext getLeftContext(AttrContext ruleContext)
          Returns the left side context to a rule context.
 int getNumberOfFreeVariables(AttrInstance tuple, AttrContext context)
          Getting the number of variables declared by an instance which have no value assigned to them yet.
 AttrContext getRightContext(AttrContext ruleContext)
          Returns the right side context to a rule context.
 AttrMapping newMapping(AttrContext mappingContext, AttrInstance source, AttrInstance target)
          Mapping between two attribute instances; The mapping is done according to the context property (rule/match) and is integrated into the context;
 AttrContext newMatchContext(AttrContext ruleContext)
          Creates and returns a new match context to a rule context.
 AttrContext newRuleContext()
          Creates and returns a new rule context.
 boolean nextMapping(AttrMapping mapping)
          Use the next possible attribute mapping;
 void removeMapping(AttrMapping mapping)
          Discard mapping; Removes variable assignments made by a mapping from its context and dissolves the connection between the attribute instances.
 

Method Detail

getAttrManager

AttrManager getAttrManager()
Returns the default attribute manager which can be used for advanced operations not provided by this facade.


newRuleContext

AttrContext newRuleContext()
Creates and returns a new rule context. Typically calls newContext( AttrMapping.PLAIN_MAP ) of the default AttrManager.


getLeftContext

AttrContext getLeftContext(AttrContext ruleContext)
Returns the left side context to a rule context. Typically calls newLeftContext( ruleContext ) of the default AttrManager.


getRightContext

AttrContext getRightContext(AttrContext ruleContext)
Returns the right side context to a rule context. Typically calls newRightContext( ruleContext ) of the default AttrManager.


checkIfReadyToMatch

void checkIfReadyToMatch(AttrContext ruleContext)
                         throws AttrException
Checking if matching can be performed with respect to a given rule context. If the rule context in question is without inconsistencies, this method remains 'silent'. Otherwise, it throws an exception whose message text describes the reason.

Throws:
AttrException

newMatchContext

AttrContext newMatchContext(AttrContext ruleContext)
Creates and returns a new match context to a rule context. Typically calls newContext( AttrMapping.MATCH_MAP, ruleContext ) of the default AttrManager.


newMapping

AttrMapping newMapping(AttrContext mappingContext,
                       AttrInstance source,
                       AttrInstance target)
                       throws AttrException
Mapping between two attribute instances; The mapping is done according to the context property (rule/match) and is integrated into the context;

Parameters:
mappingContext - The context to include the mapping in
source - Mapping source attribute
target - Mapping target attribute
Returns:
A handle to the mapping; it can be used to undo the mapping (remove()) or to proceed to the next possible one (next()). If the mapping context is that of a match, a match on the attributes is tried. If this fails, "null" is returned.
Throws:
AttrException

nextMapping

boolean nextMapping(AttrMapping mapping)
Use the next possible attribute mapping;

Returns:
"true" if more subsequent mappings exist, "false" otherwise.

removeMapping

void removeMapping(AttrMapping mapping)
Discard mapping; Removes variable assignments made by a mapping from its context and dissolves the connection between the attribute instances.


checkIfReadyToTransform

void checkIfReadyToTransform(AttrContext matchContext)
                             throws AttrException
Checking if a transformation can be performed with the attributes with respect to a given context. If the match context in question is complete and without inconsistencies, this method remains 'silent'. Otherwise, it throws an exception whose message text describes the reason.

Throws:
AttrException

getNumberOfFreeVariables

int getNumberOfFreeVariables(AttrInstance tuple,
                             AttrContext context)
Getting the number of variables declared by an instance which have no value assigned to them yet. Each variable name is counted only once, even if it is used more than once in this tuple.

Returns:
The number of free variables.

apply

void apply(AttrInstance workGraphInst,
           AttrInstance rightSideInst,
           AttrContext context)
Applying a rule; the substitutions occur "in-place" (in the recipient); In Graph Transformation, this method is applied to attributes of host graph objects, "rightSide" being an attribute of the right side of the rule and "context" being the "match"-context built up by subsequently matching the attributes of corresponding graphical objects.