public class SubtypeVisitHistory
extends java.lang.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 |
---|
SubtypeVisitHistory() |
Modifier and Type | Method and Description |
---|---|
void |
add(AnnotatedTypeMirror type1,
AnnotatedTypeMirror type2,
javax.lang.model.element.AnnotationMirror currentTop,
java.lang.Boolean b)
Add a visit for type1 and type2.
|
boolean |
contains(AnnotatedTypeMirror type1,
AnnotatedTypeMirror type2,
javax.lang.model.element.AnnotationMirror currentTop)
Returns true if type1 and type2 (or an equivalent pair) have been passed to the add method
previously.
|
void |
remove(AnnotatedTypeMirror type1,
AnnotatedTypeMirror type2,
javax.lang.model.element.AnnotationMirror currentTop)
Remove
type1 and type2 . |
java.lang.String |
toString() |
public void add(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, javax.lang.model.element.AnnotationMirror currentTop, java.lang.Boolean b)
public void remove(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, javax.lang.model.element.AnnotationMirror currentTop)
type1
and type2
.public boolean contains(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, javax.lang.model.element.AnnotationMirror currentTop)
public java.lang.String toString()
toString
in class java.lang.Object