Class UBQualifier
java.lang.Object
org.checkerframework.checker.index.upperbound.UBQualifier
- Direct Known Subclasses:
- UBQualifier.LessThanLengthOf,- UBQualifier.UpperBoundLiteralQualifier,- UBQualifier.UpperBoundUnknownQualifier
Abstraction for Upper Bound annotations. This abstract class has 4 subclasses, each of which is a
 nested class: 
UBQualifier.LessThanLengthOf, UBQualifier.UpperBoundUnknownQualifier, 
 UpperBoundBottomQualifier, and PolyQualifier.
 LTLengthOf is modeled by UBQualifier.LessThanLengthOf. LTEqLengthOf is equivalent
 to @UBQualifier.LessThanLengthOf with an offset of -1. LTOMLengthOf is equivalent to @UBQualifier.LessThanLengthOf with an offset of 1.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classThe less-than-length-of qualifier (@LTLengthOf).static classRepresents an integer value that is known at compile time.static classThe top type qualifier.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic UBQualifiercreateUBQualifier(String sequence, String offset) static UBQualifiercreateUBQualifier(List<String> sequences, List<String> offsets) Creates anUBQualifierfrom the given sequences and offsets.static UBQualifierCreates anUBQualifierfrom the given sequences and offsets, with the given additional offset.static UBQualifiercreateUBQualifier(AnnotationMirror am, String offset, UpperBoundChecker ubChecker) Create a UBQualifier from the given annotation, with an extra offset.static UBQualifiercreateUBQualifier(AnnotationMirror am, UpperBoundChecker ubChecker) Create a UBQualifier from the given annotation.static UBQualifiercreateUBQualifier(AnnotatedTypeMirror type, AnnotationMirror top, UpperBoundChecker ubChecker) Create an upper bound qualifier.abstract UBQualifierglb(UBQualifier other) booleanhasSequenceWithOffset(String sequence, int offset) Returns whether or not this qualifier has sequence with the specified offset.booleanhasSequenceWithOffset(String sequence, String offset) Returns whether or not this qualifier has sequence with the specified offset.booleanisBottom()Returns true if this UBQualifier is the bottom type.booleanisLessThanLengthOf(String sequence) Is the value with this qualifier less than the length of sequence?booleanisLessThanLengthOfAny(List<String> sequences) Is the value with this qualifier less than the length of any of the sequences?booleanbooleanisLessThanOrEqualTo(String sequence) Is the value with this qualifier less than or equal to the length of sequence?booleanReturns true if this UBQualifier represents a literal integer.booleanisPoly()Return true if this is UBQualifier.PolyQualifier.abstract booleanisSubtype(UBQualifier superType) booleanReturns true if this UBQualifier is the top type.abstract UBQualifierlub(UBQualifier other) minusOffset(int value) minusOffset(Node node, UpperBoundAnnotatedTypeFactory factory) plusOffset(int value) plusOffset(Node node, UpperBoundAnnotatedTypeFactory factory) Add the node as an offset to a copy of this qualifier.
- 
Constructor Details- 
UBQualifierpublic UBQualifier()
 
- 
- 
Method Details- 
createUBQualifierCreate a UBQualifier from the given annotation.- Parameters:
- am- the annotation to turn into a UBQualifier
- ubChecker- used to obtain the fields of- am
- Returns:
- a UBQualifier that represents the same information as the given annotation
 
- 
createUBQualifierpublic static UBQualifier createUBQualifier(AnnotationMirror am, String offset, UpperBoundChecker ubChecker) Create a UBQualifier from the given annotation, with an extra offset.- Parameters:
- am- the annotation to turn into a UBQualifier
- offset- the extra offset; may be null
- ubChecker- used to obtain the fields of- am
- Returns:
- a UBQualifier that represents the same information as the given annotation (plus an optional offset)
 
- 
createUBQualifier
- 
createUBQualifierpublic static UBQualifier createUBQualifier(AnnotatedTypeMirror type, AnnotationMirror top, UpperBoundChecker ubChecker) Create an upper bound qualifier.- Parameters:
- type- the type from which to obtain an annotation
- top- the top annotation in a hierarchy; the annotation in this hierarchy will be used
- ubChecker- used to obtain the fields of- am
- Returns:
- a new upper bound qualifier
 
- 
createUBQualifierCreates anUBQualifierfrom the given sequences and offsets. The list of sequences may not be empty. If the offsets list is empty, then an offset of 0 is used for each sequence. If the offsets list is not empty, then it must be the same size as sequence.- Parameters:
- sequences- non-empty list of sequences
- offsets- list of offset, if empty, an offset of 0 is used
- Returns:
- an UBQualifierfor the sequences with the given offsets
 
- 
createUBQualifierpublic static UBQualifier createUBQualifier(List<String> sequences, List<String> offsets, String extraOffset) Creates anUBQualifierfrom the given sequences and offsets, with the given additional offset. The list of sequences may not be empty. If the offsets list is empty, then an offset of 0 is used for each sequence. If the offsets list is not empty, then it must be the same size as sequence.- Parameters:
- sequences- non-empty list of sequences
- offsets- list of offset, if empty, an offset of 0 is used
- extraOffset- offset to add to each element of offsets; may be null
- Returns:
- an UBQualifierfor the sequences with the given offsets
 
- 
plusOffsetAdd the node as an offset to a copy of this qualifier. If this qualifier is UNKNOWN or BOTTOM, then UNKNOWN is returned. Otherwise, seeUBQualifier.LessThanLengthOf.plusOffset(int)for an explanation of how node is added as an offset.- Parameters:
- node- a Node
- factory- an AnnotatedTypeFactory
- Returns:
- a copy of this qualifier with node added as an offset
 
- 
plusOffset
- 
minusOffset
- 
minusOffset
- 
isLessThanLengthQualifierpublic boolean isLessThanLengthQualifier()
- 
isLiteralpublic boolean isLiteral()Returns true if this UBQualifier represents a literal integer.- Returns:
- true if this UBQualifier represents a literal integer
 
- 
isUnknownpublic boolean isUnknown()Returns true if this UBQualifier is the top type.- Returns:
- true if this UBQualifier is the top type
 
- 
isBottompublic boolean isBottom()Returns true if this UBQualifier is the bottom type.- Returns:
- true if this UBQualifier is the bottom type
 
- 
isPolyReturn true if this is UBQualifier.PolyQualifier.- Returns:
- true if this is UBQualifier.PolyQualifier
 
- 
isSubtype
- 
lub
- 
widenUpperBound
- 
glb
- 
isLessThanLengthOfIs the value with this qualifier less than the length of sequence?- Parameters:
- sequence- a String sequence
- Returns:
- whether or not the value with this qualifier is less than the length of sequence
 
- 
isLessThanLengthOfAnyIs the value with this qualifier less than the length of any of the sequences?- Parameters:
- sequences- list of sequences
- Returns:
- whether or not the value with this qualifier is less than the length of any of the sequences
 
- 
hasSequenceWithOffsetReturns whether or not this qualifier has sequence with the specified offset.- Parameters:
- sequence- sequence expression
- offset- the offset being looked for
- Returns:
- whether or not this qualifier has sequence with the specified offset
 
- 
hasSequenceWithOffsetReturns whether or not this qualifier has sequence with the specified offset.- Parameters:
- sequence- sequence expression
- offset- the offset being looked for
- Returns:
- whether or not this qualifier has sequence with the specified offset
 
- 
isLessThanOrEqualToIs the value with this qualifier less than or equal to the length of sequence?- Parameters:
- sequence- a String sequence
- Returns:
- whether or not the value with this qualifier is less than or equal to the length of sequence
 
 
-