01: // Copyright (c) Corporation for National Research Initiatives
02: package org.python.core;
03:
04: class ReflectedCallData {
05: public Object[] args;
06:
07: public int length;
08:
09: public Object self;
10:
11: public int errArg;
12:
13: public ReflectedCallData() {
14: this .args = Py.EmptyObjects;
15: this .length = 0;
16: this .self = null;
17: this .errArg = -2;
18: }
19:
20: public void setLength(int newLength) {
21: this .length = newLength;
22: if (newLength <= this .args.length) {
23: return;
24: }
25: this .args = new Object[newLength];
26: }
27:
28: public Object[] getArgsArray() {
29: if (this .length == this .args.length) {
30: return this .args;
31: }
32: Object[] newArgs = new Object[this .length];
33: System.arraycopy(this .args, 0, newArgs, 0, this.length);
34: this.args = newArgs;
35: return newArgs;
36: }
37: }
|