Class Subsequence
- java.lang.Object
-
- org.checkerframework.checker.index.Subsequence
-
public class Subsequence extends java.lang.Object
Holds information fromHasSubsequence
annotations.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.static @Nullable Subsequence
getSubsequenceFromTree(com.sun.source.tree.Tree varTree, BaseAnnotatedTypeFactoryForIndexChecker factory)
Returns a Subsequence representing theHasSubsequence
annotation on the declaration ofvarTree
or null if there is not such annotation.static java.lang.String
negateString(java.lang.String s)
Returns the additive inverse of the given String.java.lang.String
toString()
-
-
-
Method Detail
-
getSubsequenceFromTree
public static @Nullable Subsequence getSubsequenceFromTree(com.sun.source.tree.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
public static java.lang.String negateString(java.lang.String s)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-