|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.bytecode.Type
gnu.bytecode.ObjectType
gnu.kawa.reflect.OccurrenceType
public class OccurrenceType
A type that matches some number of repetitions of a basetype.
Field Summary | |
---|---|
static Type |
emptySequenceType
|
static ClassType |
typeOccurrenceType
|
Fields inherited from class gnu.bytecode.ObjectType |
---|
flags |
Constructor Summary | |
---|---|
OccurrenceType(Type base,
int minOccurs,
int maxOccurs)
|
Method Summary | |
---|---|
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. |
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 .... |
Type |
getBase()
|
Procedure |
getConstructor()
Get the constructor function for this type. |
Type |
getImplementationType()
The type used to implement types not natively understood by the JVM. |
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 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(java.io.ObjectInput in)
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class gnu.bytecode.ObjectType |
---|
emitCoerceFromObject, getContextClass, getField, getInternalName, getMethod, getMethods, getReflectClass, isExisting, promote, setExisting |
Methods inherited from class gnu.bytecode.Type |
---|
coerceToObject, emitCoerceToObject, emitIsInstance, getName, getSignature, getSize, getSizeInWords, getType, hashCode, isMoreSpecific, isSubtype, isValidJavaTypeName, isVoid, lookupType, lowestCommonSuperType, make, printSignature, registerTypeForClass, setName, setReflectClass, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType, swappedCompareResult |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Type emptySequenceType
public static final ClassType typeOccurrenceType
Constructor Detail |
---|
public OccurrenceType(Type base, int minOccurs, int maxOccurs)
Method Detail |
---|
public Type getBase()
public int minOccurs()
public int maxOccurs()
public static Type getInstance(Type base, int minOccurs, int maxOccurs)
public Type getImplementationType()
Type
getImplementationType
in interface TypeValue
getImplementationType
in class ObjectType
public int compare(Type other)
Type
compare
in class ObjectType
public java.lang.Object coerceFromObject(java.lang.Object obj)
Type
coerceFromObject
in class ObjectType
public boolean isInstance(java.lang.Object obj)
isInstance
in class ObjectType
public void emitTestIf(Variable incoming, Declaration decl, Compilation comp)
TypeValue
emitTestIf
in interface TypeValue
incoming
- 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 incoming 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)
TypeValue
InstanceOf
.emitIsInstance
which is a conveniece method that calls
emitTestIf
.
emitIsInstance
in interface TypeValue
incoming
- 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 Procedure getConstructor()
TypeValue
getConstructor
in interface TypeValue
public 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 static Type itemPrimeType(Type type)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public java.lang.String toString()
toString
in class Type
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |