Class GlbUtil
- java.lang.Object
-
- org.checkerframework.framework.util.typeinference.GlbUtil
-
public class GlbUtil extends java.lang.Object
A class used to determine the greatest lower bounds for a set of AnnotatedTypeMirrors.
-
-
Constructor Summary
Constructors Constructor Description GlbUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @Nullable AnnotatedTypeMirror
glbAll(java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> typeMirrors, AnnotatedTypeFactory atypeFactory)
Returns the greatest lower bound of the givenTypeMirror
s.static void
sortForGlb(java.util.List<? extends AnnotatedTypeMirror> typeMirrors, AnnotatedTypeFactory atypeFactory)
Sort the list of type mirrors, placing supertypes first and subtypes last.
-
-
-
Method Detail
-
glbAll
public static @Nullable AnnotatedTypeMirror glbAll(java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> typeMirrors, AnnotatedTypeFactory atypeFactory)
Returns the greatest lower bound of the givenTypeMirror
s. If any of the type mirrors are incomparable, Returns an AnnotatedNullType that contains the greatest lower bounds of the primary annotations of typeMirrors.Note: This method can be improved for wildcards and type variables.
- Parameters:
typeMirrors
- the types to glbatypeFactory
- the type factory- Returns:
- the greatest lower bound of typeMirrors
-
sortForGlb
public static void sortForGlb(java.util.List<? extends AnnotatedTypeMirror> typeMirrors, AnnotatedTypeFactory atypeFactory)
Sort the list of type mirrors, placing supertypes first and subtypes last.E.g. the list:
ArrayList<String>, List<String>, AbstractList<String>
becomes:List<String>, AbstractList<String>, ArrayList<String>
- Parameters:
typeMirrors
- the list to sort in placeatypeFactory
- the type factory
-
-