Enum Class AtmCombo
- All Implemented Interfaces:
Serializable
,Comparable<AtmCombo>
,Constable
An enum representing the cartesian product of the set of AtmKinds with itself. This represents
all pair-wise combinations of AnnotatedTypeMirror subclasses. AtmCombo can be used in a switch to
easily (and in a readable fashion) enumerate a subset of Atm pairs to handle. It is also used to
execute AtmComboVisitor, which is a visitor of all possible combinations of AnnotatedTypeMirror
subclasses.
For example:
switch (AtmCombo.valueOf(atm1, atm2)) {
case WILDCARD_WILDCARD:
case TYPEVAR_TYPEVAR:
doSomething(atm1, atm2);
break;
}
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <RETURN_TYPE,
PARAM>
RETURN_TYPEaccept
(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, PARAM initialParam, AtmComboVisitor<RETURN_TYPE, PARAM> visitor) Call the visit method that corresponds to the AtmCombo that represents the classes of type1 and type2.static AtmCombo
Returns the enum constant of this class with the specified name.static AtmCombo
valueOf
(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2) Returns the AtmCombo corresponding to the pair of the classes for the given AnnotatedTypeMirrors.static AtmCombo
valueOf
(org.checkerframework.framework.util.AtmKind type1, org.checkerframework.framework.util.AtmKind type2) Returns the AtmCombo corresponding to the given ATM pair of the given ATMKinds.static AtmCombo[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ARRAY_ARRAY
-
ARRAY_DECLARED
-
ARRAY_EXECUTABLE
-
ARRAY_INTERSECTION
-
ARRAY_NONE
-
ARRAY_NULL
-
ARRAY_PRIMITIVE
-
ARRAY_UNION
-
ARRAY_TYPEVAR
-
ARRAY_WILDCARD
-
DECLARED_ARRAY
-
DECLARED_DECLARED
-
DECLARED_EXECUTABLE
-
DECLARED_INTERSECTION
-
DECLARED_NONE
-
DECLARED_NULL
-
DECLARED_PRIMITIVE
-
DECLARED_TYPEVAR
-
DECLARED_UNION
-
DECLARED_WILDCARD
-
EXECUTABLE_ARRAY
-
EXECUTABLE_DECLARED
-
EXECUTABLE_EXECUTABLE
-
EXECUTABLE_INTERSECTION
-
EXECUTABLE_NONE
-
EXECUTABLE_NULL
-
EXECUTABLE_PRIMITIVE
-
EXECUTABLE_TYPEVAR
-
EXECUTABLE_UNION
-
EXECUTABLE_WILDCARD
-
INTERSECTION_ARRAY
-
INTERSECTION_DECLARED
-
INTERSECTION_EXECUTABLE
-
INTERSECTION_INTERSECTION
-
INTERSECTION_NONE
-
INTERSECTION_NULL
-
INTERSECTION_PRIMITIVE
-
INTERSECTION_TYPEVAR
-
INTERSECTION_UNION
-
INTERSECTION_WILDCARD
-
NONE_ARRAY
-
NONE_DECLARED
-
NONE_EXECUTABLE
-
NONE_INTERSECTION
-
NONE_NONE
-
NONE_NULL
-
NONE_PRIMITIVE
-
NONE_TYPEVAR
-
NONE_UNION
-
NONE_WILDCARD
-
NULL_ARRAY
-
NULL_DECLARED
-
NULL_EXECUTABLE
-
NULL_INTERSECTION
-
NULL_NONE
-
NULL_NULL
-
NULL_PRIMITIVE
-
NULL_TYPEVAR
-
NULL_UNION
-
NULL_WILDCARD
-
PRIMITIVE_ARRAY
-
PRIMITIVE_DECLARED
-
PRIMITIVE_EXECUTABLE
-
PRIMITIVE_INTERSECTION
-
PRIMITIVE_NONE
-
PRIMITIVE_NULL
-
PRIMITIVE_PRIMITIVE
-
PRIMITIVE_TYPEVAR
-
PRIMITIVE_UNION
-
PRIMITIVE_WILDCARD
-
TYPEVAR_ARRAY
-
TYPEVAR_DECLARED
-
TYPEVAR_EXECUTABLE
-
TYPEVAR_INTERSECTION
-
TYPEVAR_NONE
-
TYPEVAR_NULL
-
TYPEVAR_PRIMITIVE
-
TYPEVAR_TYPEVAR
-
TYPEVAR_UNION
-
TYPEVAR_WILDCARD
-
UNION_ARRAY
-
UNION_DECLARED
-
UNION_EXECUTABLE
-
UNION_INTERSECTION
-
UNION_NONE
-
UNION_NULL
-
UNION_PRIMITIVE
-
UNION_TYPEVAR
-
UNION_UNION
-
UNION_WILDCARD
-
WILDCARD_ARRAY
-
WILDCARD_DECLARED
-
WILDCARD_EXECUTABLE
-
WILDCARD_INTERSECTION
-
WILDCARD_NONE
-
WILDCARD_NULL
-
WILDCARD_PRIMITIVE
-
WILDCARD_TYPEVAR
-
WILDCARD_UNION
-
WILDCARD_WILDCARD
-
-
Field Details
-
type1Kind
public final org.checkerframework.framework.util.AtmKind type1KindFirst AtmKind. -
type2Kind
public final org.checkerframework.framework.util.AtmKind type2KindSecond AtmKind.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
valueOf
public static AtmCombo valueOf(org.checkerframework.framework.util.AtmKind type1, org.checkerframework.framework.util.AtmKind type2) Returns the AtmCombo corresponding to the given ATM pair of the given ATMKinds. e.g. (AtmKind.NULL, AtmKind.EXECUTABLE) => AtmCombo.NULL_EXECUTABLE.- Returns:
- the AtmCombo corresponding to the given ATM pair of the given ATMKinds. e.g. (AtmKind.NULL, AtmKind.EXECUTABLE) => AtmCombo.NULL_EXECUTABLE
-
valueOf
Returns the AtmCombo corresponding to the pair of the classes for the given AnnotatedTypeMirrors. e.g. (AnnotatedPrimitiveType, AnnotatedDeclaredType) => AtmCombo.PRIMITIVE_DECLARED- Returns:
- the AtmCombo corresponding to the pair of the classes for the given AnnotatedTypeMirrors
-
accept
public static <RETURN_TYPE,PARAM> RETURN_TYPE accept(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, PARAM initialParam, AtmComboVisitor<RETURN_TYPE, PARAM> visitor) Call the visit method that corresponds to the AtmCombo that represents the classes of type1 and type2. That is, get the combo for type1 and type 2, use it to identify the correct visitor method, and call that method with type1, type2, and initialParam as arguments to the visit method.- Type Parameters:
RETURN_TYPE
- the return type of the visitor's visit methodsPARAM
- the parameter type of the visitor's visit methods- Parameters:
type1
- first argument to the called visit methodtype2
- second argument to the called visit methodinitialParam
- the parameter passed to the called visit methodvisitor
- the visitor that is visiting the given types- Returns:
- the return value of the visit method called
-