FileDocCategorySizeDatePackage
LastCall.javaAPI DocJava SE 6 API2221Tue Jun 10 00:22:28 BST 2008com.sun.org.apache.xalan.internal.xsltc.compiler

LastCall

public final class LastCall extends FunctionCall
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen

Fields Summary
Constructors Summary
public LastCall(QName fname)

	super(fname);
    
Methods Summary
public booleanhasLastCall()

	return true;
    
public booleanhasPositionCall()

	return true;
    
public voidtranslate(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)

	final InstructionList il = methodGen.getInstructionList();

	if (methodGen instanceof CompareGenerator) {
	    il.append(((CompareGenerator)methodGen).loadLastNode());
	}
	else if (methodGen instanceof TestGenerator) {
	    il.append(new ILOAD(LAST_INDEX));
	}
	else {
	    final ConstantPoolGen cpg = classGen.getConstantPool();
	    final int getLast = cpg.addInterfaceMethodref(NODE_ITERATOR,
							  "getLast", 
							  "()I");
	    il.append(methodGen.loadIterator());
	    il.append(new INVOKEINTERFACE(getLast, 1));
	}