public class UnitsRelationsDefault extends Object implements UnitsRelations
Modifier and Type | Field and Description |
---|---|
protected Elements |
elements |
protected AnnotationMirror |
h |
protected AnnotationMirror |
km |
protected AnnotationMirror |
km2 |
protected AnnotationMirror |
kmPERh |
protected AnnotationMirror |
m |
protected AnnotationMirror |
m2 |
protected AnnotationMirror |
mm |
protected AnnotationMirror |
mm2 |
protected AnnotationMirror |
mPERs |
protected AnnotationMirror |
mPERs2 |
protected AnnotationMirror |
s |
Constructor and Description |
---|
UnitsRelationsDefault() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
bothHaveSpecificPrefix(Prefix lhtPrefix,
Prefix rhtPrefix,
Prefix specificPrefix)
Checks to see if both lhtPrefix and rhtPrefix have the same prefix as
specificPrefix
|
@Nullable AnnotationMirror |
division(AnnotatedTypeMirror lht,
AnnotatedTypeMirror rht)
Provides rules for resolving the result Unit of the division of
checker-framework provided Units
|
protected boolean |
havePairOfUnits(AnnotatedTypeMirror lht,
AnnotationMirror ul,
AnnotatedTypeMirror rht,
AnnotationMirror ur)
Checks to see if lht has the unit ul and if rht has the unit ur all at
the same time
|
protected boolean |
havePairOfUnitsIgnoringOrder(AnnotatedTypeMirror lht,
AnnotationMirror u1,
AnnotatedTypeMirror rht,
AnnotationMirror u2)
Checks to see if lht and rht have the pair of units u1 and u2 regardless
of order
|
UnitsRelations |
init(ProcessingEnvironment env)
Constructs various AnnotationMirrors representing specific
checker-framework provided Units involved in the rules resolved in this
UnitsRelations implementation
|
@Nullable AnnotationMirror |
multiplication(AnnotatedTypeMirror lht,
AnnotatedTypeMirror rht)
Provides rules for resolving the result Unit of the multiplication of
checker-framework provided Units
|
protected AnnotationMirror m
protected AnnotationMirror km
protected AnnotationMirror mm
protected AnnotationMirror m2
protected AnnotationMirror km2
protected AnnotationMirror mm2
protected AnnotationMirror s
protected AnnotationMirror h
protected AnnotationMirror mPERs
protected AnnotationMirror kmPERh
protected AnnotationMirror mPERs2
protected Elements elements
public UnitsRelations init(ProcessingEnvironment env)
init
in interface UnitsRelations
env
- The ProcessingEnvironment to use.public @Nullable AnnotationMirror multiplication(AnnotatedTypeMirror lht, AnnotatedTypeMirror rht)
multiplication
in interface UnitsRelations
lht
- Left hand side in multiplication.rht
- Right hand side in multiplication.public @Nullable AnnotationMirror division(AnnotatedTypeMirror lht, AnnotatedTypeMirror rht)
division
in interface UnitsRelations
lht
- Left hand side in division.rht
- Right hand side in division.protected boolean bothHaveSpecificPrefix(Prefix lhtPrefix, Prefix rhtPrefix, Prefix specificPrefix)
lhtPrefix
- Left hand side prefixrhtPrefix
- Right hand side prefixspecificPrefix
- Specific desired prefix to matchprotected boolean havePairOfUnits(AnnotatedTypeMirror lht, AnnotationMirror ul, AnnotatedTypeMirror rht, AnnotationMirror ur)
lht
- Left hand annotated typeul
- Left hand unitrht
- Right hand annotated typeur
- Right hand unitprotected boolean havePairOfUnitsIgnoringOrder(AnnotatedTypeMirror lht, AnnotationMirror u1, AnnotatedTypeMirror rht, AnnotationMirror u2)
lht
- Left hand annotated typeu1
- Unit 1rht
- Right hand annotated typeu2
- Unit 2