Package randoop.reflection
Class TypeTupleSet
- java.lang.Object
-
- randoop.reflection.TypeTupleSet
-
class TypeTupleSet extends Object
Represents a set of lists of candidate type arguments for aParameterizedType
, and uses this set to construct substitutions for a list ofTypeArgument
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 ofSubstitution
objects is created by a call tofilter(List)
.
-
-
Field Summary
Fields Modifier and Type Field Description private int
tupleLength
The length of tuples in the set.private List<List<ReferenceType>>
typeTuples
The list of type lists (tuples).
-
Constructor Summary
Constructors Constructor Description TypeTupleSet()
Creates a tuple set with a single empty tuple.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extend(List<ReferenceType> types)
Extends all of the elements of the current tuple set with all of the types in the given list.(package private) List<Substitution>
filter(List<TypeVariable> typeParameters)
Returns a list of substitutions for type tuples that can instantiate the given list ofTypeArgument
objects, and filters the set of tuples.
-
-
-
Field Detail
-
typeTuples
private List<List<ReferenceType>> typeTuples
The list of type lists (tuples).
-
tupleLength
private int tupleLength
The length of tuples in the set.
-
-
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 ofTypeArgument
objects, and filters the set of tuples.- Parameters:
typeParameters
- the type arguments- Returns:
- the list of substitutions that instantiate the type arguments
-
-