## org.eclipse.m2m.atl.adt.ui.text.atl.types
Class Feature

    java.lang.Object
      org.eclipse.m2m.atl.adt.ui.text.atl.types.Feature

All Implemented Interfaces:
  java.lang.Comparable<Feature>

Direct Known Subclasses:
  Operation

    public class Feature

extends java.lang.Object
implements java.lang.Comparable<Feature>

The Feature wrapper.

Field Summary
`protected java.lang.String` `documentation`
`protected java.lang.String` `name`

Constructor Summary
`Feature(UnitType unit, org.eclipse.emf.ecore.EObject declaration, java.lang.String name, OclAnyType contextType, OclAnyType type, boolean ordered, boolean container, int lower, int upper)` Creates a new feature using the given parameters.
`Feature(UnitType unit, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String metamodelName)` Creates a new feature from an EMF one.

Method Summary
`int` `compareTo(Feature o)`
`static Feature` `createFromAttribute(UnitType unit, org.eclipse.emf.ecore.EObject attribute, OclAnyType context)` Utility method to initialize a Feature from an ATL model attribute helper.
`boolean` `equals(java.lang.Object obj)`
`OclAnyType` `getContextType()`
`org.eclipse.emf.ecore.EObject` `getDeclaration()`
`java.lang.String` `getDocumentation()` Returns the information related to the operation, or null if not found.
`protected static java.lang.String` `getDocumentation(org.eclipse.emf.ecore.EObject element)` Retrieves the comments associated with the given element.
`java.lang.String` `getImagePath()`
`java.lang.String` `getInformation()` Returns a description of the feature.
`int` `getLowerBound()`
`java.lang.String` `getName()`
`java.lang.String` `getOppositeName()`
`OclAnyType` `getType()` Returns the feature type.
`UnitType` `getUnit()`
`int` `getUpperBound()`
`int` `hashCode()`
`boolean` `isContainer()`
`boolean` `isMany()`
`boolean` `isOrdered()`
`void` `setDocumentation(java.lang.String documentation)`
`void` `setImagePath(java.lang.String imagePath)`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### name

    protected java.lang.String name

### documentation

    protected java.lang.String documentation

Constructor Detail

### Feature

    public Feature(UnitType unit,
                   org.eclipse.emf.ecore.EObject declaration,
                   java.lang.String name,
                   OclAnyType contextType,
                   OclAnyType type,
                   boolean ordered,
                   boolean container,
                   int lower,
                   int upper)

  Creates a new feature using the given parameters.

  Parameters:
    `unit` - the atl unit containing the declaration
    `declaration` - the feature declaration
    `name` - the feature name
    `contextType` - the feature context type
    `type` - the feature type
    `ordered` - the feature "is ordered" flag
    `container` - the feature "is container" flag
    `lower` - the feature lower bound
    `upper` - the feature upper bound

### Feature

    public Feature(UnitType unit,
                   org.eclipse.emf.ecore.EStructuralFeature feature,
                   java.lang.String metamodelName)

  Creates a new feature from an EMF one.

  Parameters:
    `unit` - the atl unit containing the declaration
    `feature` - the EMF feature
    `metamodelName` - the metamodel name

Method Detail

### isOrdered

    public boolean isOrdered()

### isMany

    public boolean isMany()

### getOppositeName

    public java.lang.String getOppositeName()

### isContainer

    public boolean isContainer()

### getName

    public java.lang.String getName()

### getType

    public OclAnyType getType()

  Returns the feature type.

  Returns:
    the feature type

### getDeclaration

    public org.eclipse.emf.ecore.EObject getDeclaration()

### getContextType

    public OclAnyType getContextType()

### equals

    public boolean equals(java.lang.Object obj)

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

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`
  See Also:
    `Object.hashCode()`

### getLowerBound

    public int getLowerBound()

### getUpperBound

    public int getUpperBound()

### setImagePath

    public void setImagePath(java.lang.String imagePath)

### getImagePath

    public java.lang.String getImagePath()

### createFromAttribute

    public static Feature createFromAttribute(UnitType unit,
                                              org.eclipse.emf.ecore.EObject attribute,
                                              OclAnyType context)

  Utility method to initialize a Feature from an ATL model attribute helper.

  Parameters:
    `unit` - the atl unit containing the declaration
    `attribute` - the attribute helper model element
    `context` - the attribute context type
  Returns:
    the Feature

### getUnit

    public UnitType getUnit()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`
  See Also:
    `Object.toString()`

### compareTo

    public int compareTo(Feature o)

  Specified by:
    `compareTo` in interface `java.lang.Comparable<Feature>`
  See Also:
    `Comparable.compareTo(java.lang.Object)`

### getInformation

    public java.lang.String getInformation()

  Returns a description of the feature.

  Returns:
    a description of the feature

### getDocumentation

    public java.lang.String getDocumentation()

  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)

### getDocumentation

    protected static java.lang.String getDocumentation(org.eclipse.emf.ecore.EObject element)

  Retrieves the comments associated with the given element.

  Parameters:
    `element` - the given ATL element
  Returns:
    the comments

Copyright 2007 IBM Corporation and others. All Rights Reserved.