public abstract class UBQualifier extends Object
UpperBoundUnknown
is modeled as UBQualifier.UpperBoundUnknownQualifier
and UpperBoundBottom
is modeled as UBQualifier.UpperBoundBottomQualifier
.
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 |
static class |
UBQualifier.UpperBoundUnknownQualifier |
Constructor and Description |
---|
UBQualifier() |
Modifier and Type | Method and Description |
---|---|
static UBQualifier |
createUBQualifier(AnnotatedTypeMirror type,
AnnotationMirror top) |
static UBQualifier |
createUBQualifier(AnnotationMirror am)
Create a UBQualifier from the given annotation.
|
static UBQualifier |
createUBQualifier(AnnotationMirror am,
String offset)
Create a UBQualifier from the given annotation, with an extra offset
|
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() |
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 |
isPoly() |
abstract boolean |
isSubtype(UBQualifier superType) |
boolean |
isUnknown() |
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)
am
- the annotation to turn into a UBQualifierpublic static UBQualifier createUBQualifier(AnnotationMirror am, String offset)
am
- the annotation to turn into a UBQualifieroffset
- the extra offset; may be nullpublic static UBQualifier createUBQualifier(String sequence, String offset)
public static UBQualifier createUBQualifier(AnnotatedTypeMirror type, AnnotationMirror top)
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
- AnnotatedTypeFactorypublic UBQualifier plusOffset(int value)
public UBQualifier minusOffset(Node node, UpperBoundAnnotatedTypeFactory factory)
public UBQualifier minusOffset(int value)
public boolean isLessThanLengthQualifier()
public boolean isUnknown()
public boolean isBottom()
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