Class TypeTupleSet


  • class TypeTupleSet
    extends Object
    Represents a set of lists of candidate type arguments for a ParameterizedType, and uses this set to construct substitutions for a list of TypeArgument objects.

    Starts as a singleton list with the empty list, which is expanded by repeated use of the extend(List) method that adds new types to the lists in the set, then the set of Substitution objects is created by a call to filter(List).

    • Field Detail

      • tupleLength

        private int tupleLength
        The length of tuples in the set.
    • Constructor Detail

      • TypeTupleSet

        TypeTupleSet()
        Creates a tuple set with a single empty tuple.
    • Method Detail

      • extend

        public void extend​(List<ReferenceType> types)
        Extends all of the elements of the current tuple set with all of the types in the given list. In other words, if there are k types given then each tuple will be replaced by k new tuples extended by one of the input types.
        Parameters:
        types - the list of types
      • filter

        List<Substitution> filter​(List<TypeVariable> typeParameters)
        Returns a list of substitutions for type tuples that can instantiate the given list of TypeArgument objects, and filters the set of tuples.
        Parameters:
        typeParameters - the type arguments
        Returns:
        the list of substitutions that instantiate the type arguments