KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > core > PyBuiltinFunctionNarrow


1 package org.python.core;
2
3 public abstract class PyBuiltinFunctionNarrow extends PyBuiltinFunction {
4     
5     public PyBuiltinFunctionNarrow(Info info) {
6         super(info);
7     }
8
9     public PyObject __call__(PyObject[] args, String JavaDoc[] keywords) {
10         if (keywords.length != 0) {
11             throw info.unexpectedCall(args.length, true);
12         }
13         return __call__(args);
14
15     }
16
17     public PyObject __call__(PyObject[] args) {
18         switch (args.length) {
19             case 0 :
20                 return __call__();
21             case 1 :
22                 return __call__(args[0]);
23             case 2 :
24                 return __call__(args[0], args[1]);
25             case 3 :
26                 return __call__(args[0], args[1], args[2]);
27             case 4 :
28                 return __call__(args[0], args[1], args[2], args[3]);
29             default :
30                 return wide_call(getSelf(), args);
31         }
32     }
33
34     public PyObject inst_call(
35         PyObject self,
36         PyObject[] args,
37         String JavaDoc[] keywords) {
38         if (keywords.length != 0) {
39             throw info.unexpectedCall(args.length, true);
40         }
41         return inst_call(self, args);
42     }
43
44     public PyObject inst_call(PyObject self, PyObject[] args) {
45         switch (args.length) {
46             case 0 :
47                 return inst_call(self);
48             case 1 :
49                 return inst_call(self, args[0]);
50             case 2 :
51                 return inst_call(self, args[0], args[1]);
52             case 3 :
53                 return inst_call(self, args[0], args[1], args[2]);
54             case 4 :
55                 return inst_call(self, args[0], args[1], args[2], args[3]);
56             default :
57                 return wide_call(self, args);
58         }
59
60     }
61
62     /* hooks */
63
64     public PyObject __call__() {
65         return inst_call(getSelf());
66     }
67
68     public PyObject __call__(PyObject arg0) {
69         return inst_call(getSelf(), arg0);
70     }
71
72     public PyObject __call__(PyObject arg0, PyObject arg1) {
73         return inst_call(getSelf(), arg0, arg1);
74     }
75
76     public PyObject __call__(PyObject arg0, PyObject arg1, PyObject arg2) {
77         return inst_call(getSelf(), arg0, arg1, arg2);
78     }
79
80     public PyObject __call__(
81         PyObject arg0,
82         PyObject arg1,
83         PyObject arg2,
84         PyObject arg3) {
85         return inst_call(getSelf(), arg0, arg1, arg2, arg3);
86     }
87
88     protected PyObject wide_call(PyObject self, PyObject[] wide_args) {
89         throw info.unexpectedCall(wide_args.length, false);
90     }
91
92     public PyObject inst_call(PyObject self) {
93         throw info.unexpectedCall(0, false);
94     }
95
96     public PyObject inst_call(PyObject self, PyObject arg0) {
97         throw info.unexpectedCall(1, false);
98     }
99
100     public PyObject inst_call(PyObject self, PyObject arg0, PyObject arg1) {
101         throw info.unexpectedCall(2, false);
102     }
103
104     public PyObject inst_call(
105         PyObject self,
106         PyObject arg0,
107         PyObject arg1,
108         PyObject arg2) {
109         throw info.unexpectedCall(3, false);
110     }
111
112     public PyObject inst_call(
113         PyObject self,
114         PyObject arg0,
115         PyObject arg1,
116         PyObject arg2,
117         PyObject arg3) {
118         throw info.unexpectedCall(4, false);
119     }
120     
121 }
122
Popular Tags