-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathPyBuiltinFunctionSet.java
More file actions
43 lines (36 loc) · 1.29 KB
/
PyBuiltinFunctionSet.java
File metadata and controls
43 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) Corporation for National Research Initiatives
package org.python.core;
/**
* A helper class for faster implementations of commonly called methods.
* <p>
* Subclasses of PyBuiltinFunctionSet will implement some or all of the __call__
* method with a switch on the index number.
*
*/
@Untraversable
public class PyBuiltinFunctionSet extends PyBuiltinFunctionNarrow {
// used as an index into a big switch statement in the various derived
// class's __call__() methods.
protected final int index;
/**
* Creates a PyBuiltinFunctionSet that expects 1 argument.
*/
public PyBuiltinFunctionSet(String name, int index){
this(name, index, 1);
}
public PyBuiltinFunctionSet(String name, int index, int numargs){
this(name, index, numargs, numargs);
}
public PyBuiltinFunctionSet(String name, int index, int minargs, int maxargs){
this(name, index, minargs, maxargs, null);
}
// full-blown constructor, specifying everything
public PyBuiltinFunctionSet(String name,
int index,
int minargs,
int maxargs,
String doc) {
super(name, minargs, maxargs, doc);
this.index = index;
}
}