Class UnitsRelationsDefault
java.lang.Object
org.checkerframework.checker.units.UnitsRelationsDefault
- All Implemented Interfaces:
- UnitsRelations
Default relations between SI units.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ElementsThe Element Utilities from the Units Checker's processing environment.protected AnnotationMirrorSI base units.protected AnnotationMirrorNon-SI unitsprotected AnnotationMirrorSI base units.protected AnnotationMirrorSI base units.protected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorNon-SI unitsprotected AnnotationMirrorDerived SI units with special namesprotected AnnotationMirrorSI base units.protected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorSI base units.protected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorDerived SI units without special namesprotected AnnotationMirrorDerived SI units with special namesprotected AnnotationMirrorSI base units.protected AnnotationMirrorNon-SI units
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanbothHaveSpecificPrefix(Prefix lhtPrefix, Prefix rhtPrefix, Prefix specificPrefix) Checks to see if both lhtPrefix and rhtPrefix have the same prefix as specificPrefix.division(AnnotatedTypeMirror lht, AnnotatedTypeMirror rht) Provides rules for resolving the result Unit of the division of checker-framework provided Units.protected booleanhavePairOfUnits(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 booleanhavePairOfUnitsIgnoringOrder(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.Constructs various AnnotationMirrors representing specific checker-framework provided Units involved in the rules resolved in this UnitsRelations implementation.Provides rules for resolving the result Unit of the multiplication of checker-framework provided Units.
- 
Field Details- 
mSI base units.
- 
kmSI base units.
- 
mmSI base units.
- 
sSI base units.
- 
gSI base units.
- 
kgSI base units.
- 
m2Derived SI units without special names
- 
km2Derived SI units without special names
- 
mm2Derived SI units without special names
- 
m3Derived SI units without special names
- 
km3Derived SI units without special names
- 
mm3Derived SI units without special names
- 
mPERsDerived SI units without special names
- 
mPERs2Derived SI units without special names
- 
NDerived SI units with special names
- 
kNDerived SI units with special names
- 
hNon-SI units
- 
kmPERhNon-SI units
- 
tNon-SI units
- 
elementsThe Element Utilities from the Units Checker's processing environment.
 
- 
- 
Constructor Details- 
UnitsRelationsDefaultpublic UnitsRelationsDefault()
 
- 
- 
Method Details- 
initConstructs various AnnotationMirrors representing specific checker-framework provided Units involved in the rules resolved in this UnitsRelations implementation.- Specified by:
- initin interface- UnitsRelations
- Parameters:
- env- the ProcessingEnvironment to use
- Returns:
- a reference to "this"
 
- 
multiplicationProvides rules for resolving the result Unit of the multiplication of checker-framework provided Units.- Specified by:
- multiplicationin interface- UnitsRelations
- Parameters:
- lht- left hand side in multiplication
- rht- right hand side in multiplication
- Returns:
- the annotation to use for the result of the multiplication or null if no special relation is known
 
- 
divisionProvides rules for resolving the result Unit of the division of checker-framework provided Units.- Specified by:
- divisionin interface- UnitsRelations
- Parameters:
- lht- left hand side in division
- rht- right hand side in division
- Returns:
- the annotation to use for the result of the division or null if no special relation is known
 
- 
bothHaveSpecificPrefixChecks to see if both lhtPrefix and rhtPrefix have the same prefix as specificPrefix.- Parameters:
- lhtPrefix- left hand side prefix
- rhtPrefix- right hand side prefix
- specificPrefix- specific desired prefix to match
- Returns:
- true if all 3 Prefix are the same, false otherwise
 
- 
havePairOfUnitsprotected 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.- Parameters:
- lht- left hand annotated type
- ul- left hand unit
- rht- right hand annotated type
- ur- right hand unit
- Returns:
- true if lht has lu and rht has ru, false otherwise
 
- 
havePairOfUnitsIgnoringOrderprotected 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.- Parameters:
- lht- left hand annotated type
- u1- unit 1
- rht- right hand annotated type
- u2- unit 2
- Returns:
- true if lht and rht have the pair of units u1 and u2 regardless of order, false otherwise
 
 
-