Class Subsequence
- java.lang.Object
-
- org.checkerframework.checker.index.Subsequence
-
public class Subsequence extends java.lang.ObjectHolds information fromHasSubsequenceannotations.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @Nullable SubsequencegetSubsequenceFromReceiver(JavaExpression expr, BaseAnnotatedTypeFactoryForIndexChecker factory)Returns a Subsequence representing theHasSubsequenceannotation on the declaration ofrecor null if there is not such annotation.static @Nullable SubsequencegetSubsequenceFromTree(com.sun.source.tree.Tree varTree, BaseAnnotatedTypeFactoryForIndexChecker factory)Returns a Subsequence representing theHasSubsequenceannotation on the declaration ofvarTreeor null if there is not such annotation.static java.lang.StringnegateString(java.lang.String s)Returns the additive inverse of the given String.java.lang.StringtoString()
-
-
-
Method Detail
-
getSubsequenceFromTree
public static @Nullable Subsequence getSubsequenceFromTree(com.sun.source.tree.Tree varTree, BaseAnnotatedTypeFactoryForIndexChecker factory)
Returns a Subsequence representing theHasSubsequenceannotation on the declaration ofvarTreeor 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 theHasSubsequenceannotation on the declaration ofrecor 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:
toStringin classjava.lang.Object
-
-