Search in sources :

Example 1 with FOR_INIT

use of spoon.reflect.path.CtRole.FOR_INIT in project spoon by INRIA.

the class CtForImpl method setForInit.

@Override
public <T extends CtFor> T setForInit(List<CtStatement> statements) {
    if (statements == null || statements.isEmpty()) {
        this.forInit = CtElementImpl.emptyList();
        return (T) this;
    }
    getFactory().getEnvironment().getModelChangeListener().onListDeleteAll(this, FOR_INIT, this.forInit, new ArrayList<>(this.forInit));
    this.forInit.clear();
    for (CtStatement stmt : statements) {
        addForInit(stmt);
    }
    return (T) this;
}
Also used : FOR_INIT(spoon.reflect.path.CtRole.FOR_INIT) CtStatement(spoon.reflect.code.CtStatement)

Aggregations

CtStatement (spoon.reflect.code.CtStatement)1 FOR_INIT (spoon.reflect.path.CtRole.FOR_INIT)1