Class BoundedType

java.lang.Object
org.checkerframework.afu.scenelib.type.Type
org.checkerframework.afu.scenelib.type.BoundedType

public class BoundedType extends Type
A Java bounded type. For example:
   K extends Object
   E super String
   ? super String
 
Calling 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.
  • Constructor Details

    • BoundedType

      public BoundedType(DeclaredType name, BoundedType.BoundKind boundKind, DeclaredType bound)
      Creates a new bounded type.
      Parameters:
      name - the type variable name
      boundKind - the bound kind
      bound - 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 name
      boundKind - the bound kind
      bound - the bound
  • Method Details

    • getName

      public DeclaredType getName()
      Gets the type variable name. For example, 'K' in:
         K extends Object
       
      Returns:
      the type variable name
    • getBound

      public Type getBound()
      Gets the bound of this type.
      Returns:
      the bound
    • getBoundKind

      public BoundedType.BoundKind getBoundKind()
      Gets the bound kind of this type.
      Returns:
      the bound kind
    • getKind

      public Type.Kind getKind()
      Description copied from class: Type
      Gets the Type.Kind of this Type.
      Specified by:
      getKind in class Type
      Returns:
      the kind
    • addAnnotation

      public void addAnnotation(String annotation)
      Description copied from class: Type
      Adds an outer annotation to this type.
      Overrides:
      addAnnotation in class Type
      Parameters:
      annotation - the annotation to add
    • getAnnotation

      public String getAnnotation(int index)
      Description copied from class: Type
      Gets an outer annotation on this type at the given index.
      Overrides:
      getAnnotation in class Type
      Parameters:
      index - the index
      Returns:
      the annotation
    • getAnnotations

      public List<String> getAnnotations()
      Description copied from class: Type
      Gets a copy of the outer annotations on this type. This will be empty if there are none.
      Overrides:
      getAnnotations in class Type
      Returns:
      the annotations