org.eclipse.incquery.runtime.matchers.psystem.rewriters

## Class PBodyCopier

- java.lang.Object
- - org.eclipse.incquery.runtime.matchers.psystem.rewriters.PBodyCopier

- Direct Known Subclasses:
    FlattenerCopier

      public class PBodyCopier
      extends java.lang.Object

  This class can create a new PBody for a PQuery. The result body contains a copy of given variables and constraints.
  Author:
    Marton Bur

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PBodyCopier(PBody body)`
    `PBodyCopier(PQuery query)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PBody` | `getCopiedBody()` Returns the body with the copied variables and constraints.
    `java.util.Map<PVariable,PVariable>` | `getVariableMapping()`
    `void` | `mergeBody(PBody sourceBody)`
    `void` | `mergeBody(PBody sourceBody, IVariableRenamer namingTool, IConstraintFilter filter)` Merge all variables and constraints from a source body to a target body.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PBodyCopier

          public PBodyCopier(PBody body)

    - #### PBodyCopier

          public PBodyCopier(PQuery query)

  - ### Method Detail

    - #### getVariableMapping

          public java.util.Map<PVariable,PVariable> getVariableMapping()

    - #### mergeBody

          public void mergeBody(PBody sourceBody)

    - #### mergeBody

          public void mergeBody(PBody sourceBody,
                                IVariableRenamer namingTool,
                                IConstraintFilter filter)

      Merge all variables and constraints from a source body to a target body. If multiple bodies are merged into a single one, use the renamer and filter options to avoid collisions.
      Parameters:
        `sourceBody` -
        `namingTool` -
        `filter` -

    - #### getCopiedBody

          public PBody getCopiedBody()

      Returns the body with the copied variables and constraints. The returned body is still uninitialized.