org.fulib.scenarios.ast.decl.MethodDecl Maven / Gradle / Ivy
Show all versions of fulibScenarios Show documentation
// Generated by GenTreeSrc v0.10.2
// DO NOT EDIT - CHANGES WILL BE LOST ON RE-GENERATE
package org.fulib.scenarios.ast.decl;
import java.util.List;
import org.fulib.scenarios.ast.Node;
import org.fulib.scenarios.ast.Positioned;
import org.fulib.scenarios.ast.sentence.SentenceList;
import org.fulib.scenarios.ast.type.Type;
public interface MethodDecl extends Decl
{
// =============== Static Methods ===============
static MethodDecl of(ClassDecl owner, String name, List parameters, Type type, SentenceList body) { return new Impl(owner, name, parameters, type, body); }
// =============== Properties ===============
ClassDecl getOwner();
void setOwner(ClassDecl owner);
String getName();
void setName(String name);
List getParameters();
void setParameters(List parameters);
Type getType();
void setType(Type type);
SentenceList getBody();
void setBody(SentenceList body);
// =============== Methods ===============
default R accept(MethodDecl.Visitor
visitor, P par) { return visitor.visit(this, par); }
@Override default
R accept(Decl.Visitor
visitor, P par) { return visitor.visit(this, par); }
@Override default
R accept(Positioned.Visitor
visitor, P par) { return visitor.visit(this, par); }
@Override default
R accept(Node.Visitor
visitor, P par) { return visitor.visit(this, par); }
// =============== Classes ===============
class Impl extends Positioned.Impl implements MethodDecl
{
// =============== Fields ===============
private ClassDecl owner;
private String name;
private List parameters;
private Type type;
private SentenceList body;
// =============== Constructors ===============
public Impl() {}
public Impl(ClassDecl owner, String name, List parameters, Type type, SentenceList body)
{
this.owner = owner;
this.name = name;
this.parameters = parameters;
this.type = type;
this.body = body;
}
// =============== Properties ===============
@Override public ClassDecl getOwner() { return this.owner; }
@Override public void setOwner(ClassDecl owner) { this.owner = owner; }
@Override public String getName() { return this.name; }
@Override public void setName(String name) { this.name = name; }
@Override public List getParameters() { return this.parameters; }
@Override public void setParameters(List parameters) { this.parameters = parameters; }
@Override public Type getType() { return this.type; }
@Override public void setType(Type type) { this.type = type; }
@Override public SentenceList getBody() { return this.body; }
@Override public void setBody(SentenceList body) { this.body = body; }
}
interface Visitor
{
// =============== Methods ===============
default R visit(MethodDecl methodDecl, P par) { throw new UnsupportedOperationException(this.getClass().getName() + ".visit(" + methodDecl.getClass().getName() + ")"); }
}
}