Class BoundedType
java.lang.Object
org.checkerframework.afu.scenelib.type.Type
org.checkerframework.afu.scenelib.type.BoundedType
A Java bounded type. For example:
K extends Object E super String ? super StringCalling
addAnnotation(String), getAnnotation(int), or getAnnotations()
on a BoundedType will result in an UnsupportedOperationException. Annotations
should be added to the name and bound of this BoundedType.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBoundedType(DeclaredType name, com.sun.tools.javac.code.BoundKind boundKind, DeclaredType bound) Creates a new bounded type.BoundedType(DeclaredType name, BoundedType.BoundKind boundKind, DeclaredType bound) Creates a new bounded type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(String annotation) Adds an outer annotation to this type.getAnnotation(int index) Gets an outer annotation on this type at the given index.Gets a copy of the outer annotations on this type.getBound()Gets the bound of this type.Gets the bound kind of this type.getKind()getName()Gets the type variable name.Methods inherited from class org.checkerframework.afu.scenelib.type.Type
clearAnnotations, setAnnotations
-
Constructor Details
-
BoundedType
Creates a new bounded type.- Parameters:
name- the type variable nameboundKind- the bound kindbound- the bound
-
BoundedType
public BoundedType(DeclaredType name, com.sun.tools.javac.code.BoundKind boundKind, DeclaredType bound) Creates a new bounded type.- Parameters:
name- the type variable nameboundKind- the bound kindbound- the bound
-
-
Method Details
-
getName
Gets the type variable name. For example, 'K' in:K extends Object
- Returns:
- the type variable name
-
getBound
Gets the bound of this type.- Returns:
- the bound
-
getBoundKind
Gets the bound kind of this type.- Returns:
- the bound kind
-
getKind
Description copied from class:Type -
addAnnotation
Description copied from class:TypeAdds an outer annotation to this type.- Overrides:
addAnnotationin classType- Parameters:
annotation- the annotation to add
-
getAnnotation
Description copied from class:TypeGets an outer annotation on this type at the given index.- Overrides:
getAnnotationin classType- Parameters:
index- the index- Returns:
- the annotation
-
getAnnotations
Description copied from class:TypeGets a copy of the outer annotations on this type. This will be empty if there are none.- Overrides:
getAnnotationsin classType- Returns:
- the annotations
-