public class OccurrenceType extends ObjectType implements java.io.Externalizable, TypeValue
Type.NeverReturns| Modifier and Type | Field and Description |
|---|---|
static Type |
emptySequenceType |
static ClassType |
typeOccurrenceType |
flagsboolean_ctype, boolean_type, booleanType, booleanValue_method, byte_type, byteType, char_type, charType, clone_method, double_type, doubleType, doubleValue_method, errorType, float_type, floatType, floatValue_method, int_type, intType, intValue_method, java_lang_Class_type, javalangannotationAnnotationType, javalangBooleanType, javalangCharacterType, javalangClassType, javalanginvokeMethodHandleType, javalangNumberType, javalangObjectType, javalangStringType, javalangThrowableType, long_type, longType, longValue_method, neverReturnsType, nullType, number_type, objectType, pointer_type, reflectClass, short_type, shortType, string_type, throwable_type, toString_method, tostring_type, toStringType, typeArray0, void_type, voidType| Constructor and Description |
|---|
OccurrenceType(Type base,
int minOccurs,
int maxOccurs) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
coerceFromObject(java.lang.Object obj)
Convert an object to a value of this Type.
|
int |
compare(Type other)
Return a numeric code showing "subtype" relationship:
1: if other is a pure subtype of this;
0: if has the same values;
-1: if this is a pure subtype of other;
-2: if they have values in common but neither is a subtype of the other;
-3: if the types have no values in common.
|
Expression |
convertValue(Expression value)
Return converted expression or null.
|
void |
emitIsInstance(Variable incoming,
Compilation comp,
Target target)
Emit code for incoming instanceof this_type.
|
void |
emitTestIf(Variable incoming,
Declaration decl,
Compilation comp)
Emit code for
if (incoming instanceof this_type) decl = incoming ....
|
java.lang.String |
encodeType(Language language) |
Type |
getBase() |
Procedure |
getConstructor()
Get the constructor function for this type.
|
Type |
getImplementationType()
Return Java-level implementation type.
|
static Type |
getInstance(Type base,
int minOccurs,
int maxOccurs) |
boolean |
isInstance(java.lang.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 estimate 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(java.io.ObjectInput in) |
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
emitCoerceFromObject, getContextClass, getContextClassLoader, getField, getInternalName, getMethod, getMethods, getMethods, getReflectClass, isExisting, promote, setExistingcoerceToObject, emitCoerceToObject, emitConvertFromPrimitive, emitIsInstance, getGenericSignature, getMaybeGenericSignature, getName, getRawType, getRealType, getSignature, getSize, getSizeInWords, getType, hashCode, isCompatibleWithValue, isInterface, isMoreSpecific, isSubtype, isValidJavaTypeName, isVoid, lookupType, lowestCommonSuperType, make, make, printSignature, registerTypeForClass, setGenericSignature, setName, setReflectClass, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType, swappedCompareResultpublic static final Type emptySequenceType
public static final ClassType typeOccurrenceType
public OccurrenceType(Type base, int minOccurs, int maxOccurs)
public Type getBase()
public int minOccurs()
public int maxOccurs()
public Type getImplementationType()
TypegetImplementationType in interface TypeValuegetImplementationType in class Typepublic int compare(Type other)
Typecompare in class ObjectTypepublic java.lang.Object coerceFromObject(java.lang.Object obj)
TypecoerceFromObject in class ObjectTypepublic boolean isInstance(java.lang.Object obj)
isInstance in class ObjectTypepublic void emitTestIf(Variable incoming, Declaration decl, Compilation comp)
TypeValueemitTestIf in interface TypeValueincoming - Contains the value we are testing to see if it has the
type of this. If null, use top-of-stack.
May not be null if decl is non-null.decl - If non-null, assign value after coercion to Declaration.comp - The compilation state.public void emitIsInstance(Variable incoming, Compilation comp, Target target)
TypeValueInstanceOf
.emitIsInstance which is a conveniece method that calls
emitTestIf.emitIsInstance in interface TypeValueincoming - Contains the value we are testing to see if it has the
the type of 'this'. If null, use top-of-stack.comp - The compilation state.target - Where to leave the result.public Expression convertValue(Expression value)
TypeValueconvertValue in interface TypeValuepublic Procedure getConstructor()
TypeValuegetConstructor in interface TypeValuepublic static int itemCountRange(Type type)
maxCount << 12 | minCount & 0xFFF,
where a maxCount of -1 means unbounded.public static char itemCountCode(Type type)
public static boolean itemCountIsZeroOrOne(Type type)
public static boolean itemCountIsOne(Type type)
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.String encodeType(Language language)
encodeType in interface TypeValue