Top Description Methods
org.checkerframework.checker.index.qual

public @Interface LengthOf

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:TYPE_USE, TYPE_PARAMETER, METHOD
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

An integer that, for each of the given sequences, is equal to the sequence's length.

This is treated as an IndexOrHigh annotation internally. This is an implementation detail that may change in the future, when this type may be used to implement more precise refinements.

The usual use case for the LengthOf annotation is in the defintions of custom collections. Consider the signature of java.lang.String#length():


    public @LengthOf("this") int length()

Method Summary

Modifier and TypeMethod and Description
public String[]
value()

Sequences that the annotated expression is equal to the length of.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String[] value()

Sequences that the annotated expression is equal to the length of.