R - the result of scanning the two AnnotatedTypeMirrorspublic abstract class DoubleAnnotatedTypeScanner<R> extends AnnotatedTypeScanner<R,AnnotatedTypeMirror>
AnnotatedTypeScanner that scans two AnnotatedTypeMirrors simultaneously and
performs defaultAction(AnnotatedTypeMirror, AnnotatedTypeMirror) on the pair. Both
AnnotatedTypeMirrors must have the same structure, or a subclass must arrange not to continue
recursing past the point at which their structure diverges.
If the default action does not return a result, then R should be Void and
DoubleAnnotatedTypeScanner() should be used to construct the scanner. If the default
action returns a result, then specify a AnnotatedTypeScanner.reduce(R, R) function and use DoubleAnnotatedTypeScanner(Reduce, Object).
AnnotatedTypeScannerAnnotatedTypeScanner.Reduce<R>defaultResult, reduceFunction, visitedNodes| Modifier | Constructor and Description |
|---|---|
protected |
DoubleAnnotatedTypeScanner()
Constructs an AnnotatedTypeScanner where the reduce function returns the first result if it is
nonnull; otherwise the second result is returned.
|
protected |
DoubleAnnotatedTypeScanner(AnnotatedTypeScanner.Reduce<R> reduce,
R defaultResult)
Creates a scanner with the given
reduce function and defaultResult. |
reduce, reset, scan, scanAndReduce, visit, visit, visitNoType, visitNull, visitPrimitiveprotected DoubleAnnotatedTypeScanner()
null.protected DoubleAnnotatedTypeScanner(AnnotatedTypeScanner.Reduce<R> reduce, R defaultResult)
reduce function and defaultResult.reduce - function used to combine the results of scandefaultResult - result to use by defaultprotected abstract R defaultAction(AnnotatedTypeMirror type, AnnotatedTypeMirror p)
type - the type to visitp - a visitor-specified parameterprotected R scan(Iterable<? extends AnnotatedTypeMirror> types1, Iterable<? extends AnnotatedTypeMirror> types2)
types1 - typestypes2 - typestypes1 and types2
or AnnotatedTypeScanner.defaultResult if they are emptyprotected R scanAndReduce(Iterable<? extends AnnotatedTypeMirror> types, Iterable<? extends AnnotatedTypeMirror> p, R r)
scan(java.lang.Iterable<? extends org.checkerframework.framework.type.AnnotatedTypeMirror>, java.lang.Iterable<? extends org.checkerframework.framework.type.AnnotatedTypeMirror>) on types and p, then run AnnotatedTypeScanner.reduce(R, R) on the result (plus r) to return a
single element.protected final R scanAndReduce(Iterable<? extends AnnotatedTypeMirror> types, AnnotatedTypeMirror p, R r)
scanAndReduce in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>protected R scan(AnnotatedTypeMirror type, AnnotatedTypeMirror p)
AnnotatedTypeScannertype by calling type.accept(this, p); this method may be overridden by
subclasses.scan in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - type to scanp - the parameter to usetypepublic final R visitDeclared(AnnotatedTypeMirror.AnnotatedDeclaredType type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitDeclared in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitDeclared in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameterpublic final R visitArray(AnnotatedTypeMirror.AnnotatedArrayType type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitArray in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitArray in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameterpublic final R visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitExecutable in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitExecutable in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameterpublic R visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitTypeVariable in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitTypeVariable in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameterpublic R visitWildcard(AnnotatedTypeMirror.AnnotatedWildcardType type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitWildcard in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitWildcard in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameterpublic R visitIntersection(AnnotatedTypeMirror.AnnotatedIntersectionType type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitIntersection in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitIntersection in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameterpublic R visitUnion(AnnotatedTypeMirror.AnnotatedUnionType type, AnnotatedTypeMirror p)
AnnotatedTypeVisitorvisitUnion in interface AnnotatedTypeVisitor<R,AnnotatedTypeMirror>visitUnion in class AnnotatedTypeScanner<R,AnnotatedTypeMirror>type - the type to visitp - a visitor-specified parameter