1 package net.sourceforge.phpdt.internal.compiler.ast;
4 * @author Matthieu Casanova
6 public class ElseIf extends Statement {
8 public Expression condition;
10 public Statement[] statements;
12 public ElseIf(Expression condition, Statement[] statements, int sourceStart, int sourceEnd) {
13 super(sourceStart, sourceEnd);
14 this.condition = condition;
15 this.statements = statements;
19 * Return the object into String.
20 * @param tab how many tabs (not used here
23 public String toString(int tab) {
24 final StringBuffer buff = new StringBuffer(tabString(tab));
25 buff.append("elseif (");
26 buff.append(condition.toStringExpression());
28 for (int i = 0; i < statements.length; i++) {
29 Statement statement = statements[i];
30 buff.append(statement.toString(tab+1)).append('\n');
32 return buff.toString();