Annotation Type LTLengthOf
-
@Documented @Retention(RUNTIME) @Target({TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(LTEqLengthOf.class) public @interface LTLengthOfThe annotated expression evaluates to an integer whose value is less than the lengths of all the given sequences. This annotation is rarely used; it is more common to use@IndexFor.For example, an expression with type
@LTLengthOf({"a", "b"})is less than botha.lengthandb.length. The sequencesaandbmight have different lengths.The
@LTLengthOfannotation takes an optionaloffsetelement. If it is nonempty, then the annotated expression plus the expression inoffset[i]is less than the length of the sequence specified byvalue[i].For example, suppose expression
ehas type@LTLengthOf(value = {"a", "b"}, offset = {"-1", "x"}). Thene - 1is less thana.length, ande + xis less thanb.length.It is an error to write a
LTLengthOfannotation with a different number of sequences and offsets, if an offset is included.- See Also:
IndexFor- See the Checker Framework Manual:
- Index Checker
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String[]valueSequences, each of which is longer than the annotated expression's value.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String[]offsetThis expression plus the annotated expression is less than the length of the sequence.
-
-
-
Element Detail
-
value
@JavaExpression java.lang.String[] value
Sequences, each of which is longer than the annotated expression's value.
-
-
-
offset
@JavaExpression java.lang.String[] offset
This expression plus the annotated expression is less than the length of the sequence. Theoffsetelement must ether be empty or the same length asvalue.The expressions in
offsetmay be addition/subtraction of any number of Java expressions. For example,@LessThanLengthOf(value = "a", offset = "x + y + 2"}.- Default:
- {}
-
-