Package randoop.types
Class TypeTuple
java.lang.Object
randoop.types.TypeTuple
- All Implemented Interfaces:
Comparable<TypeTuple>
,Iterable<Type>
TypeTuple
represents an immutable ordered tuple of Type
objects. Type tuples are
primarily used to represent the input types of operations.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionApplies a capture conversion to each component of this type type tuple.int
boolean
get
(int i) Return the ith component type of this tuple.Returns the type parameters that occur in any component of this type tuple.boolean
Indicates whether any of the types in this type tuple contains a capture variable.int
hashCode()
boolean
Indicates whether any of the types in this type tuple contains a wildcard.boolean
isEmpty()
Indicates whether the tuple is empty.boolean
isGeneric
(boolean ignoreWildcards) Indicates whether the tuple has any generic components.iterator()
int
size()
Return the number of components of the tuple.substitute
(Substitution substitution) Applies a substitution to a type tuple, replacing any occurrences of type variables.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
list
The sequence of types in this type tuple.
-
-
Constructor Details
-
TypeTuple
Creates a type tuple from the list of types, preserving the order.- Parameters:
list
- the list of types
-
TypeTuple
public TypeTuple()Creates an empty type tuple.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
substitute
Applies a substitution to a type tuple, replacing any occurrences of type variables. Resulting tuple may only be partially instantiated. Returns a new TypeTuple; the receiver is not side-effected.- Parameters:
substitution
- the substitution- Returns:
- a new type tuple resulting from applying the given substitution to this tuple
-
applyCaptureConversion
Applies a capture conversion to each component of this type type tuple. Returns a new TypeTuple; the receiver is not side-effected.- Returns:
- a new type tuple after performing a capture conversion
-
get
Return the ith component type of this tuple.- Parameters:
i
- the component index- Returns:
- the component type at the position
-
getTypeParameters
Returns the type parameters that occur in any component of this type tuple.- Returns:
- the list of type parameters for this type tuple
-
hasWildcard
public boolean hasWildcard()Indicates whether any of the types in this type tuple contains a wildcard.- Returns:
- true if there is at least one wildcard occurrence
-
hasCaptureVariable
public boolean hasCaptureVariable()Indicates whether any of the types in this type tuple contains a capture variable.- Returns:
- true if there is at least one capture variable occurrence
-
isEmpty
public boolean isEmpty()Indicates whether the tuple is empty.- Returns:
- true if the tuple has no components, false otherwise
-
size
public int size()Return the number of components of the tuple.- Returns:
- the number of components of this tuple
-
isGeneric
public boolean isGeneric(boolean ignoreWildcards) Indicates whether the tuple has any generic components.- Parameters:
ignoreWildcards
- if true, disregard wildcards when checking for generics- Returns:
- true if any component of tuple is generic, false if none are
-
iterator
-
compareTo
- Specified by:
compareTo
in interfaceComparable<TypeTuple>
-