public class PyArgParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected PyObject[] |
arguments
Field arguments.
|
protected java.util.Map<java.lang.String,PyObject> |
keywords
Field keywords.
|
Constructor and Description |
---|
PyArgParser(PyObject[] args,
java.lang.String[] kws)
Construct a parser with the arguments and keywords.
|
Modifier and Type | Method and Description |
---|---|
PyObject |
arg(int index)
Return the argument at the given index, raise an IndexError if out of range.
|
PyObject |
arg(int index,
PyObject def)
Return the argument at the given index, or the default if the index is out of range.
|
boolean |
hasKw(java.lang.String kw)
Does the keyword exist?
|
PyObject |
kw(java.lang.String kw)
Return the value for the keyword, raise a KeyError if the keyword does
not exist.
|
PyObject |
kw(java.lang.String kw,
PyObject def)
Return the value for the keyword, return the default if the keyword does
not exist.
|
java.lang.String[] |
kws()
Get the array of keywords.
|
int |
numArg()
Get the number of arguments.
|
int |
numKw()
How many keywords?
|
protected void |
parse(PyObject[] args,
java.lang.String[] kws)
Method parse
|
protected java.util.Map<java.lang.String,PyObject> keywords
protected PyObject[] arguments
public PyArgParser(PyObject[] args, java.lang.String[] kws)
protected void parse(PyObject[] args, java.lang.String[] kws)
args
- kws
- public int numKw()
public boolean hasKw(java.lang.String kw)
public PyObject kw(java.lang.String kw)
public PyObject kw(java.lang.String kw, PyObject def)
public java.lang.String[] kws()
public int numArg()
public PyObject arg(int index)