public abstract class UBQualifier extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
UBQualifier.LessThanLengthOf
The less-than-length-of qualifier (@LTLengthOf).
|
static class |
UBQualifier.UpperBoundLiteralQualifier
Represents an integer value that is known at compile time.
|
static class |
UBQualifier.UpperBoundUnknownQualifier
The top type qualifier.
|
Constructor and Description |
---|
UBQualifier() |
Modifier and Type | Method and Description |
---|---|
static UBQualifier |
createUBQualifier(AnnotatedTypeMirror type,
AnnotationMirror top,
UpperBoundChecker ubChecker)
Create an upper bound qualifier.
|
static UBQualifier |
createUBQualifier(AnnotationMirror am,
String offset,
UpperBoundChecker ubChecker)
Create a UBQualifier from the given annotation, with an extra offset.
|
static UBQualifier |
createUBQualifier(AnnotationMirror am,
UpperBoundChecker ubChecker)
Create a UBQualifier from the given annotation.
|
static UBQualifier |
createUBQualifier(List<String> sequences,
List<String> offsets)
Creates an
UBQualifier from the given sequences and offsets. |
static UBQualifier |
createUBQualifier(List<String> sequences,
List<String> offsets,
String extraOffset)
Creates an
UBQualifier from the given sequences and offsets, with the given additional
offset. |
static UBQualifier |
createUBQualifier(String sequence,
String offset) |
abstract UBQualifier |
glb(UBQualifier other) |
boolean |
hasSequenceWithOffset(String sequence,
int offset)
Returns whether or not this qualifier has sequence with the specified offset.
|
boolean |
hasSequenceWithOffset(String sequence,
String offset)
Returns whether or not this qualifier has sequence with the specified offset.
|
boolean |
isBottom()
Returns true if this UBQualifier is the bottom type.
|
boolean |
isLessThanLengthOf(String sequence)
Is the value with this qualifier less than the length of sequence?
|
boolean |
isLessThanLengthOfAny(List<String> sequences)
Is the value with this qualifier less than the length of any of the sequences?
|
boolean |
isLessThanLengthQualifier() |
boolean |
isLessThanOrEqualTo(String sequence)
Is the value with this qualifier less than or equal to the length of sequence?
|
boolean |
isLiteral()
Returns true if this UBQualifier represents a literal integer.
|
boolean |
isPoly()
Return true if this is UBQualifier.PolyQualifier.
|
abstract boolean |
isSubtype(UBQualifier superType) |
boolean |
isUnknown()
Returns true if this UBQualifier is the top type.
|
abstract UBQualifier |
lub(UBQualifier other) |
UBQualifier |
minusOffset(int value) |
UBQualifier |
minusOffset(Node node,
UpperBoundAnnotatedTypeFactory factory) |
UBQualifier |
plusOffset(int value) |
UBQualifier |
plusOffset(Node node,
UpperBoundAnnotatedTypeFactory factory)
Add the node as an offset to a copy of this qualifier.
|
UBQualifier |
widenUpperBound(UBQualifier obj) |
public static UBQualifier createUBQualifier(AnnotationMirror am, UpperBoundChecker ubChecker)
am
- the annotation to turn into a UBQualifierubChecker
- used to obtain the fields of am
public static UBQualifier createUBQualifier(AnnotationMirror am, String offset, UpperBoundChecker ubChecker)
am
- the annotation to turn into a UBQualifieroffset
- the extra offset; may be nullubChecker
- used to obtain the fields of am
public static UBQualifier createUBQualifier(String sequence, String offset)
public static UBQualifier createUBQualifier(AnnotatedTypeMirror type, AnnotationMirror top, UpperBoundChecker ubChecker)
type
- the type from which to obtain an annotationtop
- the top annotation in a hierarchy; the annotation in this hierarchy will be usedubChecker
- used to obtain the fields of am
public static UBQualifier createUBQualifier(List<String> sequences, List<String> offsets)
UBQualifier
from 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.sequences
- non-empty list of sequencesoffsets
- list of offset, if empty, an offset of 0 is usedUBQualifier
for the sequences with the given offsetspublic static UBQualifier createUBQualifier(List<String> sequences, List<String> offsets, String extraOffset)
UBQualifier
from 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.sequences
- non-empty list of sequencesoffsets
- list of offset, if empty, an offset of 0 is usedextraOffset
- offset to add to each element of offsets; may be nullUBQualifier
for the sequences with the given offsetspublic UBQualifier plusOffset(Node node, UpperBoundAnnotatedTypeFactory factory)
UBQualifier.LessThanLengthOf.plusOffset(int)
for an
explanation of how node is added as an offset.node
- a Nodefactory
- an AnnotatedTypeFactorypublic UBQualifier plusOffset(int value)
public UBQualifier minusOffset(Node node, UpperBoundAnnotatedTypeFactory factory)
public UBQualifier minusOffset(int value)
public boolean isLessThanLengthQualifier()
public boolean isLiteral()
public boolean isUnknown()
public boolean isBottom()
@Pure public boolean isPoly()
public abstract boolean isSubtype(UBQualifier superType)
public abstract UBQualifier lub(UBQualifier other)
public UBQualifier widenUpperBound(UBQualifier obj)
public abstract UBQualifier glb(UBQualifier other)
public boolean isLessThanLengthOf(String sequence)
sequence
- a String sequencepublic boolean isLessThanLengthOfAny(List<String> sequences)
sequences
- list of sequencespublic boolean hasSequenceWithOffset(String sequence, int offset)
sequence
- sequence expressionoffset
- the offset being looked forpublic boolean hasSequenceWithOffset(String sequence, String offset)
sequence
- sequence expressionoffset
- the offset being looked forpublic boolean isLessThanOrEqualTo(String sequence)
sequence
- a String sequence