Class Subsequence
java.lang.Object
org.checkerframework.checker.index.Subsequence
Holds information from
HasSubsequence
annotations.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Subsequence
Returns a Subsequence representing theHasSubsequence
annotation on the declaration ofrec
or null if there is not such annotation.static Subsequence
getSubsequenceFromTree
(Tree varTree, BaseAnnotatedTypeFactoryForIndexChecker factory) Returns a Subsequence representing theHasSubsequence
annotation on the declaration ofvarTree
or null if there is not such annotation.static String
Returns the additive inverse of the given String.toString()
-
Field Details
-
array
Name of the Subsequence. -
from
First index of the subsequence in the backing sequence. -
to
Last index of the subsequence in the backing sequence.
-
-
Method Details
-
getSubsequenceFromTree
public static Subsequence getSubsequenceFromTree(Tree varTree, BaseAnnotatedTypeFactoryForIndexChecker factory) Returns a Subsequence representing theHasSubsequence
annotation on the declaration ofvarTree
or null if there is not such annotation.Note that this method does not standardize or viewpoint adapt the arguments to the annotation, unlike getSubsequenceFromReceiver.
- Parameters:
varTree
- some treefactory
- an AnnotatedTypeFactory- Returns:
- null or a new Subsequence from the declaration of
varTree
-
getSubsequenceFromReceiver
public static @Nullable Subsequence getSubsequenceFromReceiver(JavaExpression expr, BaseAnnotatedTypeFactoryForIndexChecker factory) Returns a Subsequence representing theHasSubsequence
annotation on the declaration ofrec
or null if there is not such annotation.- Parameters:
expr
- some treefactory
- an AnnotatedTypeFactory- Returns:
- null or a new Subsequence from the declaration of
varTree
-
negateString
Returns the additive inverse of the given String. That is, if the result of this method is some String s', then s + s' == 0 will evaluate to true. Note that this relies on the fact that the JavaExpression parser cannot parse multiplication, so it naively just changes '-' to '+' and vice-versa.- Parameters:
s
- a Java expression string- Returns:
- the negated string
-
toString
-