org.eclipse.viatra.query.runtime.matchers.tuple

## Class BaseLeftInheritanceTuple

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple
  - - org.eclipse.viatra.query.runtime.matchers.tuple.Tuple
    - - org.eclipse.viatra.query.runtime.matchers.tuple.BaseLeftInheritanceTuple

- All Implemented Interfaces:
    ITuple
  Direct Known Subclasses:
    LeftInheritanceTuple, LeftInheritanceTuple1, LeftInheritanceTuple2, LeftInheritanceTuple3, LeftInheritanceTuple4

      public abstract class BaseLeftInheritanceTuple
      extends Tuple

  Common functionality of left inheritance tuple implementations.

  Left inheritance tuples inherit their first few elements from another tuple, and extend it with additional "local" elements.

  Since:
    1.7

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Tuple` | `ancestor` This object contains the same elements as the ancestor on the first inheritedIndex positions
    `protected int` | `inheritedIndex` The number of elements that aren't stored locally, but inherited from an ancestor Tuple instead.

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.Tuple

      `cachedHash`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseLeftInheritanceTuple(Tuple ancestor)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract int` | `getLocalSize()`
    `protected boolean` | `internalEquals(ITuple other)` Optimized equals calculation (prediction: true, since hash values match)
    `protected abstract boolean` | `localEquals(BaseLeftInheritanceTuple other)` Checks the equivalence of local elements only, after ancestor tuple has been determined to be equal.

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

      `equals, hashCode, replaceAll, toImmutable`

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple

      `doCalcHash, getDistinctElements, getElements, invertIndex, invertIndexWithMupliplicity, raiseIndexingError, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.tuple.ITuple

      `get, getSize`

- - ### Field Detail

    - #### inheritedIndex

          protected final int inheritedIndex

      The number of elements that aren't stored locally, but inherited from an ancestor Tuple instead.

    - #### ancestor

          protected final Tuple ancestor

      This object contains the same elements as the ancestor on the first inheritedIndex positions

  - ### Constructor Detail

    - #### BaseLeftInheritanceTuple

          public BaseLeftInheritanceTuple(Tuple ancestor)

      Parameters:
        `ancestor` -

  - ### Method Detail

    - #### getLocalSize

          public abstract int getLocalSize()

      Returns:
        the number of local (non-inherited) elements

    - #### internalEquals

          protected boolean internalEquals(ITuple other)

      Optimized equals calculation (prediction: true, since hash values match)
      Overrides:
        `internalEquals` in class `AbstractTuple`

    - #### localEquals

          protected abstract boolean localEquals(BaseLeftInheritanceTuple other)

      Checks the equivalence of local elements only, after ancestor tuple has been determined to be equal.