Class AnnotatedTypeMirror.AnnotatedUnionType
- java.lang.Object
-
- org.checkerframework.framework.type.AnnotatedTypeMirror
-
- org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedUnionType
-
- All Implemented Interfaces:
org.plumelib.util.DeepCopyable<AnnotatedTypeMirror>
- Enclosing class:
- AnnotatedTypeMirror
public static class AnnotatedTypeMirror.AnnotatedUnionType extends AnnotatedTypeMirror
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.checkerframework.framework.type.AnnotatedTypeMirror
AnnotatedTypeMirror.AnnotatedArrayType, AnnotatedTypeMirror.AnnotatedDeclaredType, AnnotatedTypeMirror.AnnotatedExecutableType, AnnotatedTypeMirror.AnnotatedIntersectionType, AnnotatedTypeMirror.AnnotatedNoType, AnnotatedTypeMirror.AnnotatedNullType, AnnotatedTypeMirror.AnnotatedPrimitiveType, AnnotatedTypeMirror.AnnotatedTypeVariable, AnnotatedTypeMirror.AnnotatedUnionType, AnnotatedTypeMirror.AnnotatedWildcardType
-
-
Field Summary
Fields Modifier and Type Field Description protected @MonotonicNonNull java.util.List<AnnotatedTypeMirror.AnnotatedDeclaredType>
alternatives
The types that are unioned to form this AnnotatedUnionType.-
Fields inherited from class org.checkerframework.framework.type.AnnotatedTypeMirror
atypeFactory, EQUALITY_COMPARER, HASHCODE_VISITOR, primaryAnnotations, underlyingType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(AnnotatedTypeVisitor<R,P> v, P p)
Applies a visitor to this type.AnnotatedTypeMirror.AnnotatedUnionType
deepCopy()
Returns a deep copy of this type with annotations.AnnotatedTypeMirror.AnnotatedUnionType
deepCopy(boolean copyAnnotations)
Returns a deep copy of this type.java.util.List<AnnotatedTypeMirror.AnnotatedDeclaredType>
getAlternatives()
Returns the types that are unioned to form this AnnotatedUnionType.AnnotatedTypeMirror.AnnotatedUnionType
shallowCopy()
Returns a shallow copy of this type with annotations.AnnotatedTypeMirror.AnnotatedUnionType
shallowCopy(boolean copyAnnotations)
Returns a shallow copy of this type.-
Methods inherited from class org.checkerframework.framework.type.AnnotatedTypeMirror
addAnnotation, addAnnotation, addAnnotations, addMissingAnnotation, addMissingAnnotations, asUse, clearAnnotations, containsUninferredTypeArguments, createType, createTypeOfObject, createTypeOfRecord, directSupertypes, equals, getAnnotation, getAnnotation, getAnnotationInHierarchy, getAnnotations, getAnnotationsField, getEffectiveAnnotation, getEffectiveAnnotationInHierarchy, getEffectiveAnnotations, getErased, getExplicitAnnotations, getKind, getPrimitiveKind, getUnderlyingType, getUnderlyingTypeHashCode, hasAnnotation, hasAnnotation, hasAnnotationInHierarchy, hasAnnotationRelaxed, hasEffectiveAnnotation, hasEffectiveAnnotation, hasEffectiveAnnotationRelaxed, hasExplicitAnnotation, hasExplicitAnnotation, hasExplicitAnnotationRelaxed, hashCode, isAnnotatedInHierarchy, isDeclaration, removeAnnotation, removeAnnotationByClass, removeAnnotationInHierarchy, removeAnnotations, removeNonTopAnnotationInHierarchy, replaceAnnotation, replaceAnnotations, toString, toString
-
-
-
-
Field Detail
-
alternatives
protected @MonotonicNonNull java.util.List<AnnotatedTypeMirror.AnnotatedDeclaredType> alternatives
The types that are unioned to form this AnnotatedUnionType.Is set by
getAlternatives()
andshallowCopy(boolean)
.
-
-
Method Detail
-
accept
public <R,P> R accept(AnnotatedTypeVisitor<R,P> v, P p)
Description copied from class:AnnotatedTypeMirror
Applies a visitor to this type.- Specified by:
accept
in classAnnotatedTypeMirror
- Type Parameters:
R
- the return type of the visitor's methodsP
- the type of the additional parameter to the visitor's methods- Parameters:
v
- the visitor operating on this typep
- additional parameter to the visitor- Returns:
- a visitor-specified result
-
deepCopy
public AnnotatedTypeMirror.AnnotatedUnionType deepCopy(boolean copyAnnotations)
Description copied from class:AnnotatedTypeMirror
Returns a deep copy of this type. A deep copy implies that each component type is copied recursively and the returned type refers to those copies in its component locations.Note: deepCopy provides two important properties in the returned copy:
- Structure preservation -- The exact structure of the original AnnotatedTypeMirror is preserved in the copy including all component types.
- Annotation preservation -- All of the annotations from the original AnnotatedTypeMirror and its components have been copied to the new type.
- Specified by:
deepCopy
in classAnnotatedTypeMirror
- Returns:
- a deep copy
-
deepCopy
public AnnotatedTypeMirror.AnnotatedUnionType deepCopy()
Description copied from class:AnnotatedTypeMirror
Returns a deep copy of this type with annotations.Each subclass implements this method with the subclass return type. The method body must always be a call to deepCopy(true).
- Specified by:
deepCopy
in interfaceorg.plumelib.util.DeepCopyable<AnnotatedTypeMirror>
- Specified by:
deepCopy
in classAnnotatedTypeMirror
- Returns:
- a deep copy of this type with annotations
- See Also:
AnnotatedTypeMirror.deepCopy(boolean)
-
shallowCopy
public AnnotatedTypeMirror.AnnotatedUnionType shallowCopy(boolean copyAnnotations)
Description copied from class:AnnotatedTypeMirror
Returns a shallow copy of this type. A shallow copy implies that each component type in the output copy refers to the same object as the object being copied.- Specified by:
shallowCopy
in classAnnotatedTypeMirror
- Parameters:
copyAnnotations
- whether copy should have annotations, i.e. whether fieldannotations
should be copied.
-
shallowCopy
public AnnotatedTypeMirror.AnnotatedUnionType shallowCopy()
Description copied from class:AnnotatedTypeMirror
Returns a shallow copy of this type with annotations.Each subclass implements this method with the subclass return type. The method body must always be a call to shallowCopy(true).
- Specified by:
shallowCopy
in classAnnotatedTypeMirror
- Returns:
- a shallow copy of this type with annotations
- See Also:
AnnotatedTypeMirror.shallowCopy(boolean)
-
getAlternatives
public java.util.List<AnnotatedTypeMirror.AnnotatedDeclaredType> getAlternatives()
Returns the types that are unioned to form this AnnotatedUnionType.- Returns:
- the types that are unioned to form this AnnotatedUnionType
-
-