FileDocCategorySizeDatePackage
ASTAppender.javaAPI DocHibernate 3.2.5962Tue Jul 12 15:27:30 BST 2005org.hibernate.hql.ast.util

ASTAppender

public class ASTAppender extends Object
Appends child nodes to a parent efficiently.
author
josh Jul 24, 2004 8:28:23 AM

Fields Summary
private antlr.collections.AST
parent
private antlr.collections.AST
last
private antlr.ASTFactory
factory
Constructors Summary
public ASTAppender(antlr.ASTFactory factory, antlr.collections.AST parent)

		this( parent );
		this.factory = factory;
	
public ASTAppender(antlr.collections.AST parent)

		this.parent = parent;
		this.last = ASTUtil.getLastChild( parent );
	
Methods Summary
public antlr.collections.ASTappend(int type, java.lang.String text, boolean appendIfEmpty)

		if ( text != null && ( appendIfEmpty || text.length() > 0 ) ) {
			return append( factory.create( type, text ) );
		}
		else {
			return null;
		}
	
public antlr.collections.ASTappend(antlr.collections.AST child)

		if ( last == null ) {
			parent.setFirstChild( child );
		}
		else {
			last.setNextSibling( child );
		}
		last = child;
		return last;