org.eclipse.m2m.atl.adt.ui.text.atl.types
Class Operation

java.lang.Object
  extended by org.eclipse.m2m.atl.adt.ui.text.atl.types.Feature
      extended by org.eclipse.m2m.atl.adt.ui.text.atl.types.Operation
All Implemented Interfaces:
java.lang.Comparable<Feature>

public class Operation
extends Feature

The Operation wrapper.


Field Summary
 
Fields inherited from class org.eclipse.m2m.atl.adt.ui.text.atl.types.Feature
documentation, name
 
Constructor Summary
Operation(org.eclipse.emf.ecore.EOperation operation, java.lang.String metamodelName)
          Creates an Operation from an EOperation.
Operation(java.lang.String name, OclAnyType contextType, OclAnyType type)
          Creates a new Operation without parameters.
Operation(java.lang.String name, OclAnyType contextType, OclAnyType type, java.util.Map<java.lang.String,OclAnyType> parameters)
          Creates a new Operation.
Operation(UnitType unit, org.eclipse.emf.ecore.EObject declaration, java.lang.String name, OclAnyType contextType, OclAnyType type)
          Creates a new Operation without parameters.
Operation(UnitType unit, org.eclipse.emf.ecore.EObject declaration, java.lang.String name, OclAnyType contextType, OclAnyType type, java.util.Map<java.lang.String,OclAnyType> parameters)
          Creates a new Operation.
 
Method Summary
static Operation createFromCalledRule(UnitType unit, org.eclipse.emf.ecore.EObject rule, OclAnyType context)
          Utility method to initialize an Operation Feature from an ATL model called rule.
static Operation createFromHelper(UnitType unit, org.eclipse.emf.ecore.EObject helper, OclAnyType context)
          Utility method to initialize an Operation Feature from an ATL model helper.
static Operation createFromLazyRule(UnitType unit, org.eclipse.emf.ecore.EObject rule, OclAnyType context)
          Utility method to initialize an Operation Feature from an ATL model lazy rule.
 boolean equals(java.lang.Object obj)
          
 java.lang.String getDocumentation(OclAnyType context, java.lang.Object... parameters)
          Returns the information related to the operation, or null if not found.
 java.lang.String getInformation(OclAnyType context)
          Returns a description of the operation for the given context.
 java.util.Map<java.lang.String,OclAnyType> getParameters()
           
 OclAnyType getType(OclAnyType context, java.lang.Object... parameters)
          Returns the operation type.
 int hashCode()
          
 void setDocumentation(java.lang.String documentation)
           
 java.lang.String toString()
          
 
Methods inherited from class org.eclipse.m2m.atl.adt.ui.text.atl.types.Feature
compareTo, createFromAttribute, getContextType, getDeclaration, getDocumentation, getDocumentation, getImagePath, getInformation, getLowerBound, getName, getOppositeName, getType, getUnit, getUpperBound, isContainer, isMany, isOrdered, setImagePath
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operation

public Operation(java.lang.String name,
                 OclAnyType contextType,
                 OclAnyType type,
                 java.util.Map<java.lang.String,OclAnyType> parameters)
Creates a new Operation.

Parameters:
name - the operation name
contextType - type the operation context type
type - the operation type
parameters - the operation parameter types map

Operation

public Operation(java.lang.String name,
                 OclAnyType contextType,
                 OclAnyType type)
Creates a new Operation without parameters.

Parameters:
name - the operation name
contextType - the operation context type
type - the operation type

Operation

public Operation(UnitType unit,
                 org.eclipse.emf.ecore.EObject declaration,
                 java.lang.String name,
                 OclAnyType contextType,
                 OclAnyType type,
                 java.util.Map<java.lang.String,OclAnyType> parameters)
Creates a new Operation.

Parameters:
unit - the atl unit containing the declaration
declaration - the element declaration
name - the operation name
contextType - type the operation context type
type - the operation type
parameters - the operation parameter types map

Operation

public Operation(UnitType unit,
                 org.eclipse.emf.ecore.EObject declaration,
                 java.lang.String name,
                 OclAnyType contextType,
                 OclAnyType type)
Creates a new Operation without parameters.

Parameters:
unit - the atl unit containing the declaration
declaration - the element declaration
name - the operation name
contextType - the operation context type
type - the operation type

Operation

public Operation(org.eclipse.emf.ecore.EOperation operation,
                 java.lang.String metamodelName)
Creates an Operation from an EOperation.

Parameters:
operation - the EOperation
metamodelName - the metamodel name
Method Detail

getParameters

public java.util.Map<java.lang.String,OclAnyType> getParameters()

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class Feature
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class Feature
See Also:
Feature.hashCode()

toString

public java.lang.String toString()

Overrides:
toString in class Feature
See Also:
Object.toString()

getType

public OclAnyType getType(OclAnyType context,
                          java.lang.Object... parameters)
Returns the operation type. Operations may subclass this method for dynamic type computation.

Parameters:
context - the context type
parameters - the operation parameter types
Returns:
the operation type

getDocumentation

public java.lang.String getDocumentation(OclAnyType context,
                                         java.lang.Object... parameters)
Returns the information related to the operation, or null if not found.

Parameters:
context - the context type
parameters - the operation parameter types
Returns:
the information or null if not found

setDocumentation

public void setDocumentation(java.lang.String documentation)
Overrides:
setDocumentation in class Feature

getInformation

public java.lang.String getInformation(OclAnyType context)
Returns a description of the operation for the given context.

Parameters:
context - the current context
Returns:
a description of the operation for the given context

createFromCalledRule

public static Operation createFromCalledRule(UnitType unit,
                                             org.eclipse.emf.ecore.EObject rule,
                                             OclAnyType context)
Utility method to initialize an Operation Feature from an ATL model called rule.

Parameters:
unit - the atl unit containing the declaration
rule - the rule model element
context - the operation context type
Returns:
the Operation

createFromLazyRule

public static Operation createFromLazyRule(UnitType unit,
                                           org.eclipse.emf.ecore.EObject rule,
                                           OclAnyType context)
Utility method to initialize an Operation Feature from an ATL model lazy rule.

Parameters:
unit - the atl unit containing the declaration
rule - the rule model element
context - the operation context type
Returns:
the Operation

createFromHelper

public static Operation createFromHelper(UnitType unit,
                                         org.eclipse.emf.ecore.EObject helper,
                                         OclAnyType context)
Utility method to initialize an Operation Feature from an ATL model helper.

Parameters:
unit - the atl unit containing the declaration
helper - the helper model element
context - the operation context type
Returns:
the Operation

Copyright 2007 IBM Corporation and others.
All Rights Reserved.