//generated by abstract-syntax-gen package de.peeeq.wurstscript.jassIm; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class ImMethodImpl implements ImMethod{ ImMethodImpl(de.peeeq.wurstscript.ast.Element trace, ImClassType methodClass, String name, ImFunction implementation, java.util.List subMethods, boolean isAbstract) { if (trace == null) throw new IllegalArgumentException("Element trace must not be null."); if (methodClass == null) throw new IllegalArgumentException("Element methodClass must not be null."); if (name == null) throw new IllegalArgumentException("Element name must not be null."); if (implementation == null) throw new IllegalArgumentException("Element implementation must not be null."); if (subMethods == null) throw new IllegalArgumentException("Element subMethods must not be null."); this.trace = trace; this.methodClass = methodClass; this.name = name; this.implementation = implementation; this.subMethods = subMethods; this.isAbstract = isAbstract; } private Element parent; public Element getParent() { return parent; } public void setParent(Element parent) { if (parent != null && this.parent != null) { throw new Error("Cannot change parent of element " + this.getClass().getSimpleName() + ", as it is already used in another tree." + "Use the copy method to create a new tree or remove the tree from its old parent or set the parent to null before moving the tree. "); } this.parent = parent; } public void replaceBy(Element other) { if (parent == null) throw new RuntimeException("Node not attached to tree."); for (int i=0; i subMethods; public void setSubMethods(java.util.List subMethods) { if (subMethods == null) throw new IllegalArgumentException(); this.subMethods = subMethods; } public java.util.List getSubMethods() { return subMethods; } private boolean isAbstract; public void setIsAbstract(boolean isAbstract) { this.isAbstract = isAbstract; } public boolean getIsAbstract() { return isAbstract; } public Element get(int i) { switch (i) { default: throw new IllegalArgumentException("Index out of range: " + i); } } public Element set(int i, Element newElem) { Element oldElem; switch (i) { default: throw new IllegalArgumentException("Index out of range: " + i); } } @Override public void forEachElement(java.util.function.Consumer action) { } public int size() { return 0; } @Override public ImMethod copy() { ImMethod result = new ImMethodImpl(trace, methodClass, name, implementation, subMethods, isAbstract); return result; } @Override public ImMethod copyWithRefs() { ImMethod res = copy(); return res; } @Override public void clearAttributes() { clearAttributesLocal(); } @Override public void clearAttributesLocal() { } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(JassImElementWithName.Matcher matcher) { return matcher.case_ImMethod(this); } @Override public void match(JassImElementWithName.MatcherVoid matcher) { matcher.case_ImMethod(this); } @Override public T match(ElementWithTrace.Matcher matcher) { return matcher.case_ImMethod(this); } @Override public void match(ElementWithTrace.MatcherVoid matcher) { matcher.case_ImMethod(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_ImMethod(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_ImMethod(this); } public boolean structuralEquals(Element e) { if (e instanceof ImMethod) { ImMethod o = (ImMethod) e; return this.methodClass == o.getMethodClass() && java.util.Objects.equals(name, o.getName()) && this.implementation == o.getImplementation() && java.util.Objects.equals(subMethods, o.getSubMethods()) && java.util.Objects.equals(isAbstract, o.getIsAbstract()); } else { return false; } } /** */ public String toString() { return de.peeeq.wurstscript.translation.imtranslation.ImPrinter.asString((ImMethod)this); } /** */ public ImFunction getNearestFunc() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getNearestFunc((ImMethod)this); } /** */ public de.peeeq.wurstscript.ast.Element attrTrace() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getTrace((ImMethod)this); } /** */ public ImProg attrProg() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getProg((ImMethod)this); } /** */ public ImClass attrClass() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.attrClass((ImMethod)this); } }