gnu.kawa.reflect
public class OccurrenceType extends ObjectType implements Externalizable, TypeValue
Field Summary | |
---|---|
static Type | emptySequenceType |
static ClassType | typeOccurrenceType |
Constructor Summary | |
---|---|
OccurrenceType(Type base, int minOccurs, int maxOccurs) |
Method Summary | |
---|---|
Object | coerceFromObject(Object obj) |
int | compare(Type other) |
void | emitIsInstance(Variable incoming, Compilation comp, Target target) |
void | emitTestIf(Variable incoming, Declaration decl, Compilation comp) |
Type | getBase() |
Procedure | getConstructor() |
Type | getImplementationType() |
static Type | getInstance(Type base, int minOccurs, int maxOccurs) |
boolean | isInstance(Object obj) |
static char | itemCountCode(Type type) Returna a quantifer kind for a sequence type. |
static boolean | itemCountIsOne(Type type) |
static boolean | itemCountIsZeroOrOne(Type type) |
static int | itemCountRange(Type type) Return a conservative estimage on the min/max number of items of a type. |
static Type | itemPrimeType(Type type) QUery formal semantics "prime type" |
int | maxOccurs() |
int | minOccurs() |
void | readExternal(ObjectInput in) |
String | toString() |
void | writeExternal(ObjectOutput out) |
Returns: '0' if type is known to be a void (0-item) type; '1' if type is known to be a single-item type; '?' if type matches a sequence of 0 or 1 items; '+' if type matches a sequence of 1 or more items; '*' otherwise.
Returns: {@code maxCount << 12 | minCount & 0xFFF}, where a {@code maxCount} of -1 means unbounded.