FileDocCategorySizeDatePackage
LastCall.javaAPI DocJava SE 5 API2218Fri Aug 26 14:55:36 BST 2005com.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));
	}