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

org.python.core.PyBuiltinFunctionSet 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;

/**
 * A helper class for faster implementations of commonly called methods.
 * 

* Subclasses of PyBuiltinFunctionSet will implement some or all of the __call__ * method with a switch on the index number. * */ 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; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy