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

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

Go to download

The Checker Framework enhances Java's type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.44.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, for each of the given sequences, is equal to the sequence's length.
 *
 * 

This is treated as an {@link 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 {@code LengthOf} annotation is in the defintions of custom * collections. Consider the signature of java.lang.String#length(): * *

 *
 *     {@code public @LengthOf("this") int length()}
 * 
* * @checker_framework.manual #index-checker Index Checker */ @Documented @Retention(RetentionPolicy.RUNTIME) // Has target of METHOD so that it is stored as a declaration annotation and the SameLen Checker can // read it. @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER, ElementType.METHOD}) public @interface LengthOf { /** Sequences that the annotated expression is equal to the length of. */ String[] value(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy