|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.bytecode.Type gnu.bytecode.ObjectType gnu.kawa.xml.NodeType
public class NodeType
A SeqPosition used to represent a node in (usually) a TreeList. This is special in that the represented node is the current position of the SeqPosition - but when passed to a method it is only valid during that method. After the method returns, the caller is free to change the position, so if the node is saved in a data structure it must be copied.
Field Summary | |
---|---|
static NodeType |
anyNodeTest
|
static int |
ATTRIBUTE_OK
|
static int |
COMMENT_OK
|
static NodeType |
commentNodeTest
|
static int |
DOCUMENT_OK
|
static NodeType |
documentNodeTest
|
static int |
ELEMENT_OK
|
static NodeType |
nodeType
|
static int |
PI_OK
|
static int |
TEXT_OK
|
static NodeType |
textNodeTest
|
static ClassType |
typeKNode
|
static ClassType |
typeNodeType
|
Fields inherited from class gnu.bytecode.ObjectType |
---|
flags |
Fields inherited from class gnu.bytecode.Type |
---|
boolean_ctype, boolean_type, booleanValue_method, byte_type, char_type, clone_method, double_type, doubleValue_method, float_type, floatValue_method, int_type, intValue_method, java_lang_Class_type, long_type, longValue_method, neverReturnsType, nullType, number_type, pointer_type, reflectClass, short_type, string_type, throwable_type, toString_method, tostring_type, typeArray0, void_type |
Constructor Summary | |
---|---|
NodeType(java.lang.String name)
|
|
NodeType(java.lang.String name,
int kinds)
|
Method Summary | |
---|---|
static KNode |
coerceForce(java.lang.Object obj,
int kinds)
|
java.lang.Object |
coerceFromObject(java.lang.Object obj)
Convert an object to a value of this Type. |
static KNode |
coerceOrNull(java.lang.Object obj,
int kinds)
|
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 |
emitCoerceFromObject(CodeAttr code)
Compile (in given method) cast from Object to this Type. |
protected void |
emitCoerceOrNullMethod(Variable incoming,
Compilation comp)
|
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 .... |
Procedure |
getConstructor()
Get the constructor function for this type. |
Type |
getImplementationType()
The type used to implement types not natively understood by the JVM. |
static boolean |
isInstance(AbstractSequence seq,
int ipos,
int kinds)
|
boolean |
isInstance(java.lang.Object obj)
|
boolean |
isInstancePos(AbstractSequence seq,
int ipos)
|
void |
readExternal(java.io.ObjectInput in)
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class gnu.bytecode.ObjectType |
---|
getInternalName, 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, 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 int TEXT_OK
public static final int ELEMENT_OK
public static final int ATTRIBUTE_OK
public static final int DOCUMENT_OK
public static final int COMMENT_OK
public static final int PI_OK
public static final ClassType typeKNode
public static final ClassType typeNodeType
public static final NodeType nodeType
public static final NodeType documentNodeTest
public static final NodeType textNodeTest
public static final NodeType commentNodeTest
public static final NodeType anyNodeTest
Constructor Detail |
---|
public NodeType(java.lang.String name, int kinds)
public NodeType(java.lang.String name)
Method Detail |
---|
public void emitCoerceFromObject(CodeAttr code)
ObjectType
emitCoerceFromObject
in class ObjectType
public java.lang.Object coerceFromObject(java.lang.Object obj)
ObjectType
coerceFromObject
in class ObjectType
public Type getImplementationType()
Type
getImplementationType
in interface TypeValue
getImplementationType
in class ObjectType
public int compare(Type other)
Type
compare
in class ObjectType
public boolean isInstance(java.lang.Object obj)
isInstance
in class ObjectType
public boolean isInstancePos(AbstractSequence seq, int ipos)
isInstancePos
in interface ItemPredicate
public static boolean isInstance(AbstractSequence seq, int ipos, int kinds)
public static KNode coerceForce(java.lang.Object obj, int kinds)
public static KNode coerceOrNull(java.lang.Object obj, int kinds)
protected void emitCoerceOrNullMethod(Variable incoming, Compilation comp)
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 java.lang.String toString()
toString
in class Type
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
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 |