org.apache.xalan.xsltc.compiler.util
Class NodeSetType

java.lang.Object
  |
  +--org.apache.xalan.xsltc.compiler.util.Type
        |
        +--org.apache.xalan.xsltc.compiler.util.NodeSetType

public final class NodeSetType
extends Type


Fields inherited from class org.apache.xalan.xsltc.compiler.util.Type
Attribute, Boolean, Comment, Element, Int, Node, NodeSet, Object, Processing_Instruction, Real, Reference, ResultTree, Root, String, Text, Void
 
Method Summary
 java.lang.String getClassName()
          Returns the class name of an internal type's external representation.
 boolean identicalTo(Type other)
           
 org.apache.bcel.generic.Instruction LOAD(int slot)
           
 org.apache.bcel.generic.Instruction STORE(int slot)
           
 org.apache.bcel.generic.Type toJCType()
           
 java.lang.String toSignature()
           
 java.lang.String toString()
           
 void translateBox(ClassGenerator classGen, MethodGenerator methodGen)
          Translates an object of this type to its boxed representation.
 void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, java.lang.Class clazz)
          Translates an external Java Class into an internal type.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, BooleanType type)
          Translates a node-set into a synthesized boolean.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, java.lang.Class clazz)
          Translates a node-set into the Java type denoted by clazz.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, NodeType type)
          Expects a node-set on the stack and pushes a node.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ObjectType type)
          Subsume node-set into ObjectType.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type)
          Expects a node-set on the stack and pushes a real.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ReferenceType type)
          Expects a node-set on the stack and pushes a boxed node-set.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, StringType type)
          Translates a node-set into a string.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, Type type)
          Translates a node-set into an object of internal type type.
 FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, BooleanType type)
          Translates a node-set into a non-synthesized boolean.
 void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen)
          Translates an object of this type to its unboxed representation.
 
Methods inherited from class org.apache.xalan.xsltc.compiler.util.Type
ADD, CMP, distanceTo, DIV, DUP, GE, GT, implementedAsMethod, isNumber, isSimple, LE, LT, MUL, NEG, newObjectType, newObjectType, POP, REM, SUB, translateToDesynthesized
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class Type

identicalTo

public boolean identicalTo(Type other)
Overrides:
identicalTo in class Type

toSignature

public java.lang.String toSignature()
Overrides:
toSignature in class Type

toJCType

public org.apache.bcel.generic.Type toJCType()
Overrides:
toJCType in class Type

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        Type type)
Translates a node-set into an object of internal type type. The translation to int is undefined since node-sets are always converted to reals in arithmetic expressions.
Overrides:
translateTo in class Type
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateFrom

public void translateFrom(ClassGenerator classGen,
                          MethodGenerator methodGen,
                          java.lang.Class clazz)
Translates an external Java Class into an internal type. Expects the Java object on the stack, pushes the internal type
Overrides:
translateFrom in class Type

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        BooleanType type)
Translates a node-set into a synthesized boolean. The boolean value of a node-set is "true" if non-empty and "false" otherwise. Notice that the function getFirstNode() is called in translateToDesynthesized().
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        StringType type)
Translates a node-set into a string. The string value of a node-set is value of its first element.
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        RealType type)
Expects a node-set on the stack and pushes a real. First the node-set is converted to string, and from string to real.
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        NodeType type)
Expects a node-set on the stack and pushes a node.
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        ObjectType type)
Subsume node-set into ObjectType.
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateToDesynthesized

public FlowList translateToDesynthesized(ClassGenerator classGen,
                                         MethodGenerator methodGen,
                                         BooleanType type)
Translates a node-set into a non-synthesized boolean. It does not push a 0 or a 1 but instead returns branchhandle list to be appended to the false list.
Overrides:
translateToDesynthesized in class Type
See Also:
Type.translateToDesynthesized(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        ReferenceType type)
Expects a node-set on the stack and pushes a boxed node-set. Node sets are already boxed so the translation is just a NOP.
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        java.lang.Class clazz)
Translates a node-set into the Java type denoted by clazz. Expects a node-set on the stack and pushes an object of the appropriate type after coercion.
Overrides:
translateTo in class Type

translateBox

public void translateBox(ClassGenerator classGen,
                         MethodGenerator methodGen)
Translates an object of this type to its boxed representation.
Overrides:
translateBox in class Type

translateUnBox

public void translateUnBox(ClassGenerator classGen,
                           MethodGenerator methodGen)
Translates an object of this type to its unboxed representation.
Overrides:
translateUnBox in class Type

getClassName

public java.lang.String getClassName()
Returns the class name of an internal type's external representation.
Overrides:
getClassName in class Type

LOAD

public org.apache.bcel.generic.Instruction LOAD(int slot)
Overrides:
LOAD in class Type

STORE

public org.apache.bcel.generic.Instruction STORE(int slot)
Overrides:
STORE in class Type


Copyright 2006 Apache XML Project. All Rights Reserved.