checker.src.org.checkerframework.checker.units.UnitsRelations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checker Show documentation
Show all versions of checker Show documentation
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.
package org.checkerframework.checker.units;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.AnnotationMirror;
import org.checkerframework.framework.type.AnnotatedTypeMirror;
/*>>>
import org.checkerframework.checker.nullness.qual.Nullable;
*/
/**
* Interface that is used to specify the relation between units.
*/
public interface UnitsRelations {
/**
* Initialize the object. Needs to be called before any other method.
*
* @param env the ProcessingEnvironment to use
* @return a reference to "this"
*/
UnitsRelations init(ProcessingEnvironment env);
/**
* Called for the multiplication of type lht and rht.
*
* @param lht left hand side in multiplication
* @param rht right hand side in multiplication
* @return the annotation to use for the result of the multiplication or
* null if no special relation is known
*/
/*@Nullable*/ AnnotationMirror multiplication(AnnotatedTypeMirror lht, AnnotatedTypeMirror rht);
/**
* Called for the division of type lht and rht.
*
* @param lht left hand side in division
* @param rht right hand side in division
* @return the annotation to use for the result of the division or
* null if no special relation is known
*/
/*@Nullable*/ AnnotationMirror division(AnnotatedTypeMirror lht, AnnotatedTypeMirror rht);
}