org.eclipse.incquery.runtime.localsearch

## Class MatchingFrame

- java.lang.Object
- - org.eclipse.incquery.runtime.matchers.tuple.Tuple
  - - org.eclipse.incquery.runtime.localsearch.MatchingFrame

- All Implemented Interfaces:
    java.lang.Cloneable

      public class MatchingFrame
      extends Tuple
      implements java.lang.Cloneable

  MatchingFrame represents the actual mappings of variables to constants. A MatchingFrame maintains a reference to its corresponding Pattern (or possibly flattened pattern). The following mappings are used by the interpreted engine:
  - VariableType => PatternVariable
  - ValueType => AnyModelElement

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MatchingFrame(java.lang.Object pattern, int keySize, int frameSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MatchingFrame` | `clone()`
    `java.lang.Object` | `get(int index)`
    `java.lang.Object[]` | `getElements()` As the tuple is supposed to be immutable, do not modify the returned array.
    `MatchingKey` | `getKey()`
    `java.lang.Object` | `getPattern()`
    `int` | `getSize()`
    `java.lang.Object` | `getValue(java.lang.Integer position)` Returns the value stored inside the matching frame.
    `void` | `setValue(java.lang.Integer position, java.lang.Object value)` Sets the value of the variable at the given position
    `boolean` | `testAndSetValue(java.lang.Integer position, java.lang.Object value)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.eclipse.incquery.runtime.matchers.tuple.Tuple

      `equals, getDistinctElements, hashCode, invertIndex, invertIndexWithMupliplicity, replaceAll`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MatchingFrame

          public MatchingFrame(java.lang.Object pattern,
                               int keySize,
                               int frameSize)

  - ### Method Detail

    - #### getValue

          public java.lang.Object getValue(java.lang.Integer position)

      Returns the value stored inside the matching frame.
      Parameters:
        `position` -
      Returns:
        the element stored in the selected position in the frame, or null if it is not yet set
      Throws:
        `java.lang.IndexOutOfBoundsException` - if position is negative
        `java.lang.IllegalArgumentException` - if the position is larger then the length of the frame

    - #### setValue

          public void setValue(java.lang.Integer position,
                               java.lang.Object value)

      Sets the value of the variable at the given position
      Parameters:
        `position` - the position of the variable within the frame
        `value` - the value to be set for the variable

    - #### testAndSetValue

          public boolean testAndSetValue(java.lang.Integer position,
                                         java.lang.Object value)

    - #### getPattern

          public java.lang.Object getPattern()

      Returns:
        the pattern this frame is attached to

    - #### getKey

          public MatchingKey getKey()

    - #### clone

          public MatchingFrame clone()

      Overrides:
        `clone` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `Tuple`

    - #### getSize

          public int getSize()

      Specified by:
        `getSize` in class `Tuple`
      Returns:
        number of elements

    - #### get

          public java.lang.Object get(int index)

      Specified by:
        `get` in class `Tuple`
      Returns:
        the element at the specified index

    - #### getElements

          public java.lang.Object[] getElements()

      Description copied from class: `Tuple`
      As the tuple is supposed to be immutable, do not modify the returned array.
      Overrides:
        `getElements` in class `Tuple`
      Returns:
        the array containing all elements of this Tuple