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

org.python.core.ReflectedCallData Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
// Copyright (c) Corporation for National Research Initiatives
package org.python.core;

class ReflectedCallData {
    public Object[] args;

    public int length;

    public Object self;

    public int errArg;

    public ReflectedCallData() {
        this.args = Py.EmptyObjects;
        this.length = 0;
        this.self = null;
        this.errArg = -2;
    }

    public void setLength(int newLength) {
        this.length = newLength;
        if (newLength <= this.args.length) {
            return;
        }
        this.args = new Object[newLength];
    }

    public Object[] getArgsArray() {
        if (this.length == this.args.length) {
            return this.args;
        }
        Object[] newArgs = new Object[this.length];
        System.arraycopy(this.args, 0, newArgs, 0, this.length);
        this.args = newArgs;
        return newArgs;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy