public class VisitHistory extends Object
VisitHistory keeps track of all visits and allows clients of this class to check whether or not they have visited an equivalent pair of AnnotatedTypeMirrors already. This is necessary in order to halt visiting on recursive bounds.
This class is primarily used to implement isSubtype(ATM, ATM). The pair of types corresponds
to the subtype and the supertype being checked. A single subtype may be visited more than once,
but with a different supertype. For example, if the two types are @A T extends @B
Serializable<T>
and @C Serializable<?>
, then isSubtype is first called one those types
and then on @B Serializable<T>
and @C Serializable<?>
.
Constructor and Description |
---|
VisitHistory() |
Modifier and Type | Method and Description |
---|---|
void |
add(AnnotatedTypeMirror type1,
AnnotatedTypeMirror type2)
Add a visit for type1 and type2.
|
void |
clear() |
boolean |
contains(AnnotatedTypeMirror type1,
AnnotatedTypeMirror type2)
Returns true if type1 and type2 (or an equivalent pair) have been passed to the add method
previously.
|
String |
toString() |
public void clear()
public void add(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2)
public boolean contains(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2)