public MatchObject search(PyObject[] args, String[] kws) {
ArgParser ap = new ArgParser("search", args, kws,
"pattern", "pos", "endpos");
String string = ap.getString(0);
int start = ap.getInt(1, 0);
int end = ap.getInt(2, string.length());
...
| Modifier and Type | Field and Description |
|---|---|
| private PyObject[] | |
| private static String[] | |
| private String | |
| private String[] | |
| private String[] | |
| private static Object |
| Access | Constructor and Description |
|---|---|
| private | |
| public | ArgParser(String
Name of the function. Used in error messages. funcname, PyObject[] The actual call arguments supplied in the call. args, String[] The actual keyword names supplied in the call. kws, String The expected argument in the function definition. p0)Create an ArgParser for a one-argument function. |
| public | ArgParser(String
Name of the function. Used in error messages. funcname, PyObject[] The actual call arguments supplied in the call. args, String[] The actual keyword names supplied in the call. kws, String The first expected argument in the function definition. p0, String The second expected argument in the function definition. p1)Create an ArgParser for a two-argument function. |
| public | ArgParser(String
Name of the function. Used in error messages. funcname, PyObject[] The actual call arguments supplied in the call. args, String[] The actual keyword names supplied in the call. kws, String The first expected argument in the function definition. p0, String The second expected argument in the function definition. p1, String The third expected argument in the function definition. p2)Create an ArgParser for a three-argument function. |
| public | ArgParser(String
Name of the function. Used in error messages. funcname, PyObject[] The actual call arguments supplied in the call. args, String[] The actual keyword names supplied in the call. kws, String[] The list of expected argument in the function definition. paramnames)Create an ArgParser for a multi-argument function. |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| private void | |
| private static PyObject | |
| private Object | |
| private Object | |
| public int | getIndex(int
The position of the argument. First argument is numbered 0. pos)Return an required argument as an index. |
| public int | getIndex(int
The position of the argument. First argument is numbered 0. pos, int def)Return an optional argument as an index. |
| public int | getInt(int
The position of the argument. First argument is numbered 0. pos)Return a required argument as an int. |
| public int | getInt(int
The position of the argument. First argument is numbered 0. pos, int def)Return an optional argument as an int. |
| public PyObject | getList(int
The position of the argument. First argument is numbered 0. pos)Return the remaining arguments as a tuple. |
| private PyObject | |
| public PyObject | getPyObject(int
The position of the argument. First argument is numbered 0. pos)Return a required argument as a PyObject. |
| public PyObject | getPyObject(int
The position of the argument. First argument is numbered 0. pos, PyObject def)Return an optional argument as a PyObject. |
| public PyObject | Returns: the PyObject of PyType typethe position of the argument. First argument is numbered 0 pos, PyType the desired PyType of the argument type)Return a required argument as a PyObject, ensuring the object is of the specified type. |
| public PyObject | Returns: the PyObject of PyType typethe position of the argument. First argument is numbered 0 pos, PyType the desired PyType of the argument type, PyObject to return if the argument at pos was not given (null allowed) def)Return an optional argument as a PyObject, or return the default value provided, which may
be |
| private PyObject | |
| public String | getString(int
The position of the .. First argument is numbered 0. pos)Return a required argument as a String. |
| public String | |
| public void | |
| private static String |
| args | back to summary |
|---|---|
| private PyObject[] args | |
| emptyKws | back to summary |
|---|---|
| private static String[] emptyKws | |
| funcname | back to summary |
|---|---|
| private String funcname | |
| kws | back to summary |
|---|---|
| private String[] kws | |
| params | back to summary |
|---|---|
| private String[] params | |
| required | back to summary |
|---|---|
| private static Object required | |
| ArgParser | back to summary |
|---|---|
| private ArgParser(String funcname, PyObject[] args, String[] kws) | |
| ArgParser | back to summary |
|---|---|
| public ArgParser(String funcname, PyObject[] args, String[] kws, String p0) Create an ArgParser for a one-argument function. | |
| ArgParser | back to summary |
|---|---|
| public ArgParser(String funcname, PyObject[] args, String[] kws, String p0, String p1) Create an ArgParser for a two-argument function.
| |
| ArgParser | back to summary |
|---|---|
| public ArgParser(String funcname, PyObject[] args, String[] kws, String p0, String p1, String p2) Create an ArgParser for a three-argument function.
| |
| ArgParser | back to summary |
|---|---|
| public ArgParser(String funcname, PyObject[] args, String[] kws, String[] paramnames) Create an ArgParser for a multi-argument function. | |
| ArgParser | back to summary |
|---|---|
| public ArgParser(String funcname, PyObject[] args, String[] kws, String[] paramnames, int minargs) | |
| ArgParser | back to summary |
|---|---|
| public ArgParser(String funcname, PyObject[] args, String[] kws, String[] paramnames, int minargs, boolean takesZeroArgs) | |
| asInt | back to summary |
|---|---|
| private int asInt(PyObject value) Convert a PyObject to a Java integer.
| |
| check | back to summary |
|---|---|
| private void check() | |
| checkedForType | back to summary |
|---|---|
| private static PyObject checkedForType(PyObject arg, int pos, PyType type) | |
| getArg | back to summary |
|---|---|
| private Object getArg(int pos, Class<T> clss, String classname) | |
| getArg | back to summary |
|---|---|
| private Object getArg(int pos, Class<T> clss, String classname, Object def) | |
| getIndex | back to summary |
|---|---|
| public int getIndex(int pos) Return an required argument as an index.
| |
| getIndex | back to summary |
|---|---|
| public int getIndex(int pos, int def) Return an optional argument as an index.
| |
| getInt | back to summary |
|---|---|
| public int getInt(int pos) Return a required argument as an int.
| |
| getInt | back to summary |
|---|---|
| public int getInt(int pos, int def) Return an optional argument as an int.
| |
| getList | back to summary |
|---|---|
| public PyObject getList(int pos) Return the remaining arguments as a tuple.
| |
| getOptionalArg | back to summary |
|---|---|
| private PyObject getOptionalArg(int pos) | |
| getPyObject | back to summary |
|---|---|
| public PyObject getPyObject(int pos) Return a required argument as a PyObject.
| |
| getPyObject | back to summary |
|---|---|
| public PyObject getPyObject(int pos, PyObject def) Return an optional argument as a PyObject.
| |
| getPyObjectByType | back to summary |
|---|---|
| public PyObject getPyObjectByType(int pos, PyType type) Return a required argument as a PyObject, ensuring the object is of the specified type.
the PyObject of PyType type | |
| getPyObjectByType | back to summary |
|---|---|
| public PyObject getPyObjectByType(int pos, PyType type, PyObject def) Return an optional argument as a PyObject, or return the default value provided, which may
be
the PyObject of PyType type | |
| getRequiredArg | back to summary |
|---|---|
| private PyObject getRequiredArg(int pos) | |
| getString | back to summary |
|---|---|
| public String getString(int pos) Return a required argument as a String.
| |
| getString | back to summary |
|---|---|
| public String getString(int pos, String def) Return an optional argument as a String.
| |
| noKeywords | back to summary |
|---|---|
| public void noKeywords() Ensure no keyword arguments were passed, raising a TypeError if so. | |
| ordinal | back to summary |
|---|---|
| private static String ordinal(int n) | |