EDU.utwente.CoCompose.translate
Class FlatteningOptionsVisitor

java.lang.Object
  extended byEDU.utwente.CoCompose.lang.ModelVisitor
      extended byEDU.utwente.CoCompose.translate.FlatteningOptionsVisitor
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Runnable

public class FlatteningOptionsVisitor
extends ModelVisitor
implements java.lang.Cloneable

Retrieves the flattening options for a composite.

Version:
0.1.17, 19 November 2003
Author:
Dennis Wagelaar

Field Summary
protected  java.util.Set patternsInPath
          The set of solution patterns used in the flattening path.
 
Fields inherited from class EDU.utwente.CoCompose.lang.ModelVisitor
log
 
Constructor Summary
FlatteningOptionsVisitor()
          Constructs a FlatteningOptionsVisitor.
 
Method Summary
protected  void addOption(SolutionPattern option)
          Adds an option to the collection of flattening options.
 java.lang.Object clone()
          Returns a copy of this object.
 java.util.Collection getOptions()
          Retrieves the flattening options so far.
protected  java.lang.String getTargetLanguage()
          Gets the target language to use for flattening.
 void reset()
          Resets this visitor to the state it was in just after creation.
 void setAppliedPatterns(AppliedPatterns patterns)
          Sets the appliedPatterns property for caching of validated solution patterns.
 void setTargetLanguage(java.lang.String language)
          Sets the target language to use for flattening.
 void visitComposite(Composite composite)
          Gets the flattening options (solution patterns or nothing) that can be used for flattening the composite.
 void visitConcept(Concept concept)
          Checks a Concept object for translation to the target language.
 void visitSolutionPattern(SolutionPattern solution)
          Checks whether the solution pattern can eventually translate into the given language.
 
Methods inherited from class EDU.utwente.CoCompose.lang.ModelVisitor
getUpdate, run, setErrorReporter, setLogger, setUpdate, startModel, visitAbstractConcept, visitCompositePartConcept, visitCompositeRole, visitConstrainedConcept, visitImplementation, visitImplementationGenerator, visitImplementationRolePart, visitLink, visitModel, visitPublishedConcept, visitSolutionRole
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patternsInPath

protected java.util.Set patternsInPath
The set of solution patterns used in the flattening path.

Constructor Detail

FlatteningOptionsVisitor

public FlatteningOptionsVisitor()
Constructs a FlatteningOptionsVisitor.

Method Detail

getTargetLanguage

protected java.lang.String getTargetLanguage()
Gets the target language to use for flattening.

Returns:
the target language.

addOption

protected void addOption(SolutionPattern option)
Adds an option to the collection of flattening options.

Parameters:
option - - the option to add.

reset

public void reset()
Resets this visitor to the state it was in just after creation.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a copy of this object.

Returns:
a copy of this object.
Throws:
CloneNotSupportedException.
java.lang.CloneNotSupportedException

setTargetLanguage

public void setTargetLanguage(java.lang.String language)
Sets the target language to use for flattening.

Parameters:
language - - the target language.

setAppliedPatterns

public void setAppliedPatterns(AppliedPatterns patterns)
Sets the appliedPatterns property for caching of validated solution patterns.

Parameters:
patterns - - the AppliedPatterns object.

getOptions

public java.util.Collection getOptions()
Retrieves the flattening options so far.

Returns:
the collection of flattening options (contains SolutionPatterns and/or null).

visitConcept

public void visitConcept(Concept concept)
                  throws CoComposeException
Checks a Concept object for translation to the target language.

Overrides:
visitConcept in class ModelVisitor
Parameters:
concept - - the concept to check.
Throws:
CoComposeException - - if the concept does not translate.

visitComposite

public void visitComposite(Composite composite)
                    throws CoComposeException
Gets the flattening options (solution patterns or nothing) that can be used for flattening the composite.

Overrides:
visitComposite in class ModelVisitor
Parameters:
composite - - the composite to visit.
Throws:
CoComposeException - - if no flattening is possible.

visitSolutionPattern

public void visitSolutionPattern(SolutionPattern solution)
                          throws CoComposeException
Checks whether the solution pattern can eventually translate into the given language.

Overrides:
visitSolutionPattern in class ModelVisitor
Parameters:
solution - - the solution pattern to visit.
Throws:
CoComposeException - - if translation is not possible.