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

public @Interface IndexOrHigh

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

An integer that, for each of the given sequences, is either a valid index or is equal to the sequence's length.

The Arrays.binarySearch method is declared as

class Arrays {
  int binarySearch(Object[] a, @IndexFor("#1") int fromIndex, @IndexOrHigh("#1") int toIndex, Object key)
}

Writing @IndexOrHigh("arr") is equivalent to writing @NonNegative @LTEqLengthOf("arr"), and that is how it is treated internally by the checker. Thus, if you write an @IndexFor("arr") annotation, you might see warnings about @NonNegative or @LTEqLengthOf.

See Also
NonNegative, LTLengthOf

Method Summary

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

Sequences that the annotated expression is a valid index for or is equal to the lengeth of.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String[] value()

Sequences that the annotated expression is a valid index for or is equal to the lengeth of.