All Downloads are FREE. Search and download functionalities are using the official Maven repository.

quark._BoundMethod Maven / Gradle / Ivy

There is a newer version: 2.0.37
Show newest version
/* Quark 1.0.452 run at 2016-11-11 16:09:46.008093 */
package quark;

public class _BoundMethod implements UnaryCallable, io.datawire.quark.runtime.QObject {
    public static quark.reflect.Class quark__BoundMethod_ref = datawire_mdk_md.Root.quark__BoundMethod_md;
    public Object target;
    public quark.reflect.Method method;
    public java.util.ArrayList additionalArgs;
    public _BoundMethod(Object target, String methodName, java.util.ArrayList additionalArgs) {
        (this).target = target;
        (this).method = (quark.reflect.Class.get(io.datawire.quark.runtime.Builtins._getClass(target))).getMethod(methodName);
        (this).additionalArgs = additionalArgs;
    }
    public Object call(Object arg) {
        java.util.ArrayList args = (new ListUtil()).slice(this.additionalArgs, 0, (this.additionalArgs).size());
        (args).add((0), (arg));
        return ((this).method).invoke((this).target, args);
    }
    public String _getClass() {
        return "quark._BoundMethod";
    }
    public Object _getField(String name) {
        if ((name)==("target") || ((Object)(name) != null && ((Object) (name)).equals("target"))) {
            return (this).target;
        }
        if ((name)==("method") || ((Object)(name) != null && ((Object) (name)).equals("method"))) {
            return (this).method;
        }
        if ((name)==("additionalArgs") || ((Object)(name) != null && ((Object) (name)).equals("additionalArgs"))) {
            return (this).additionalArgs;
        }
        return null;
    }
    public void _setField(String name, Object value) {
        if ((name)==("target") || ((Object)(name) != null && ((Object) (name)).equals("target"))) {
            (this).target = value;
        }
        if ((name)==("method") || ((Object)(name) != null && ((Object) (name)).equals("method"))) {
            (this).method = (quark.reflect.Method) (value);
        }
        if ((name)==("additionalArgs") || ((Object)(name) != null && ((Object) (name)).equals("additionalArgs"))) {
            (this).additionalArgs = (java.util.ArrayList) (value);
        }
    }
}