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

## Interface ITuple

- All Known Subinterfaces:
    IModifiableTuple
  All Known Implementing Classes:
    AbstractTuple, BaseFlatTuple, BaseLeftInheritanceTuple, FlatTuple, FlatTuple0, FlatTuple1, FlatTuple2, FlatTuple3, FlatTuple4, LeftInheritanceTuple, LeftInheritanceTuple1, LeftInheritanceTuple2, LeftInheritanceTuple3, LeftInheritanceTuple4, MaskedTuple, MatchingFrame, Tuple, VolatileMaskedTuple, VolatileModifiableMaskedTuple, VolatileTuple

      public interface ITuple

  Represents both mutable and immutable tuples
  Since:
    1.7

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `get(int index)`
    `<T> java.util.Set<T>` | `getDistinctElements()`
    `java.lang.Object[]` | `getElements()` As the tuple is supposed to be immutable, do not modify the returned array.
    `int` | `getSize()`
    `java.util.Map<java.lang.Object,java.lang.Integer>` | `invertIndex()` Calculates an inverted index of the elements of this pattern.
    `java.util.Map<java.lang.Object,java.util.List<java.lang.Integer>>` | `invertIndexWithMupliplicity()` Calculates an inverted index of the elements of this pattern.
    `Tuple` | `toImmutable()`

- - ### Method Detail

    - #### get

          java.lang.Object get(int index)

      Returns:
        the element at the specified index

    - #### getElements

          java.lang.Object[] getElements()

      As the tuple is supposed to be immutable, do not modify the returned array.
      Returns:
        the array containing all elements of this Tuple

    - #### getDistinctElements

          <T> java.util.Set<T> getDistinctElements()

      Returns:
        the set containing all distinct elements of this Tuple, cast as type T

    - #### getSize

          int getSize()

      Returns:
        number of elements

    - #### invertIndex

          java.util.Map<java.lang.Object,java.lang.Integer> invertIndex()

      Calculates an inverted index of the elements of this pattern. For each element, the index of the (last) occurrence is calculated.
      Returns:
        the inverted index mapping each element of this pattern to its index in the array

    - #### invertIndexWithMupliplicity

          java.util.Map<java.lang.Object,java.util.List<java.lang.Integer>> invertIndexWithMupliplicity()

      Calculates an inverted index of the elements of this pattern. For each element, the index of all of its occurrences is calculated.
      Returns:
        the inverted index mapping each element of this pattern to its index in the array

    - #### toImmutable

          Tuple toImmutable()