01: package org.python.core;
02:
03: public abstract class PyBuiltinMethodNarrow extends PyBuiltinMethod {
04:
05: public PyBuiltinMethodNarrow(PyObject self, Info info) {
06: super (self, info);
07: }
08:
09: public PyObject __call__(PyObject[] args, String[] keywords) {
10: if (keywords.length != 0) {
11: throw info.unexpectedCall(args.length, true);
12: }
13: return __call__(args);
14: }
15:
16: public PyObject __call__(PyObject[] args) {
17: switch (args.length) {
18: case 0:
19: return __call__();
20: case 1:
21: return __call__(args[0]);
22: case 2:
23: return __call__(args[0], args[1]);
24: case 3:
25: return __call__(args[0], args[1], args[2]);
26: case 4:
27: return __call__(args[0], args[1], args[2], args[3]);
28: default:
29: throw info.unexpectedCall(args.length, false);
30: }
31: }
32:
33: public PyObject __call__() {
34: throw info.unexpectedCall(0, false);
35: }
36:
37: public PyObject __call__(PyObject arg0) {
38: throw info.unexpectedCall(1, false);
39: }
40:
41: public PyObject __call__(PyObject arg0, PyObject arg1) {
42: throw info.unexpectedCall(2, false);
43: }
44:
45: public PyObject __call__(PyObject arg0, PyObject arg1, PyObject arg2) {
46: throw info.unexpectedCall(3, false);
47: }
48:
49: public PyObject __call__(PyObject arg0, PyObject arg1,
50: PyObject arg2, PyObject arg3) {
51: throw info.unexpectedCall(4, false);
52: }
53: }
|