com.espertech.esper.codegen.model.statement.CodegenStatementAssignArrayElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of esper Show documentation
Show all versions of esper Show documentation
Complex event processing and event series analysis component
The newest version!
/*
***************************************************************************************
* Copyright (C) 2006 EsperTech, Inc. All rights reserved. *
* http://www.espertech.com/esper *
* http://www.espertech.com *
* ---------------------------------------------------------------------------------- *
* The software in this package is published under the terms of the GPL license *
* a copy of which has been included with this distribution in the license.txt file. *
***************************************************************************************
*/
package com.espertech.esper.codegen.model.statement;
import com.espertech.esper.codegen.model.expression.CodegenExpression;
import java.util.Map;
import java.util.Set;
public class CodegenStatementAssignArrayElement extends CodegenStatementBase {
private final CodegenExpression array;
private final CodegenExpression index;
private final CodegenExpression expression;
public CodegenStatementAssignArrayElement(CodegenExpression array, CodegenExpression index, CodegenExpression expression) {
this.array = array;
this.index = index;
this.expression = expression;
}
public void renderStatement(StringBuilder builder, Map imports, boolean isInnerClass) {
array.render(builder, imports, isInnerClass);
builder.append("[");
index.render(builder, imports, isInnerClass);
builder.append("]=");
expression.render(builder, imports, isInnerClass);
}
public void mergeClasses(Set classes) {
array.mergeClasses(classes);
index.mergeClasses(classes);
expression.mergeClasses(classes);
}
}