All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.checkerframework.checker.index.qual.IndexOrLow Maven / Gradle / Ivy

There is a newer version: 9.3.0
Show newest version
package org.checkerframework.checker.index.qual;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * An integer that is either -1 or is a valid index for each of the given sequences.
 *
 * 

The * {@code String.indexOf(String)} method is declared as * *


 *   class String {
 *    {@literal @}IndexOrLow("this") int indexOf(String str) { ... }
 *   }
 * 
* *

Writing {@code @IndexOrLow("arr")} is equivalent to writing {@link * GTENegativeOne @GTENegativeOne} {@link LTLengthOf @LTLengthOf("arr")}, and that is how it is * treated internally by the checker. Thus, if you write an {@code @IndexOrLow("arr")} annotation, * you might see warnings about {@code @GTENegativeOne} or {@code @LTLengthOf}. * * @see GTENegativeOne * @see LTLengthOf * @checker_framework.manual #index-checker Index Checker */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) public @interface IndexOrLow { /** Sequences that the annotated expression is a valid index for (or it's -1). */ String[] value(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy