Class EquivalentAtmComboScanner.Visited
java.lang.Object
org.checkerframework.framework.type.visitor.EquivalentAtmComboScanner.Visited
- Enclosing class:
EquivalentAtmComboScanner<RETURN_TYPE,PARAM>
A history of type pairs that have already been visited and the return type of their visit.
The table, slotFor(java.lang.Object[], java.lang.Object, java.lang.Object), EquivalentAtmComboScanner.INITIAL_CAPACITY and EquivalentAtmComboScanner.ENTRY_SLOTS are
package-private so that the unit test of this class can inspect the table layout.
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, RETURN_TYPE ret) Add a new pair to the history.voidclear()Clears the history.booleancontains(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2) Returns true if the given pair has been recorded.getResult(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2) Returns the result recorded for the given pair, or null if none was recorded.booleanisEmpty()Returns true if no pairs have been recorded.
-
Method Details
-
isEmpty
public boolean isEmpty()Returns true if no pairs have been recorded.- Returns:
- true if no pairs have been recorded
-
clear
public void clear()Clears the history. A table of the initial size is cleared in place; a larger one is dropped, so that the cost of clearing stays bounded. -
contains
Returns true if the given pair has been recorded.- Parameters:
type1- the first typetype2- the second type- Returns:
- true if the given pair has been recorded
-
getResult
Returns the result recorded for the given pair, or null if none was recorded.- Parameters:
type1- the first typetype2- the second type- Returns:
- the result recorded for the given pair, or null if none was recorded
-
add
Add a new pair to the history.- Parameters:
type1- the first typetype2- the second typeret- the result
-