From: Finn B. <bc...@us...> - 2001-02-25 16:35:30
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv32232 Modified Files: ArgParser.java Log Message: Added javadoc comments. Index: ArgParser.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/ArgParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ArgParser.java 2001/02/21 14:32:50 1.3 --- ArgParser.java 2001/02/25 16:36:42 1.4 *************** *** 2,6 **** /** ! * A utilityclass for handling mixed positional and keyword arguments. * * A typical usage: --- 2,6 ---- /** ! * A utility class for handling mixed positional and keyword arguments. * * A typical usage: *************** *** 41,44 **** --- 41,51 ---- } + /** + * Create an ArgParser with one method argument + * @param funcname Name of the method. Used in error messages. + * @param args The actual call arguments supplied in the call. + * @param args The actual keyword names supplied in the call. + * @param p0 The expected argument in the method definition. + */ public ArgParser(String funcname, PyObject[] args, String[] kws, String p0) { *************** *** 48,51 **** --- 55,66 ---- } + /** + * Create an ArgParser with two method argument + * @param funcname Name of the method. Used in error messages. + * @param args The actual call arguments supplied in the call. + * @param args The actual keyword names supplied in the call. + * @param p0 The first expected argument in the method definition. + * @param p1 The second expected argument in the method definition. + */ public ArgParser(String funcname, PyObject[] args, String[] kws, String p0, String p1) { *************** *** 55,58 **** --- 70,82 ---- } + /** + * Create an ArgParser with three method argument + * @param funcname Name of the method. Used in error messages. + * @param args The actual call arguments supplied in the call. + * @param args The actual keyword names supplied in the call. + * @param p0 The first expected argument in the method definition. + * @param p1 The second expected argument in the method definition. + * @param p2 The third expected argument in the method definition. + */ public ArgParser(String funcname, PyObject[] args, String[] kws, String p0, String p1, String p2) { *************** *** 62,65 **** --- 86,96 ---- } + /** + * Create an ArgParser with three method argument + * @param funcname Name of the method. Used in error messages. + * @param args The actual call arguments supplied in the call. + * @param args The actual keyword names supplied in the call. + * @param paramnames The list of expected argument in the method definition. + */ public ArgParser(String funcname, PyObject[] args, String[] kws, String[] paramnames) { *************** *** 70,77 **** --- 101,118 ---- + /** + * Return a required argument as a String. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public String getString(int pos) { return (String) getArg(pos, String.class, "string"); } + /** + * Return an optional argument as a String. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public String getString(int pos, String def) { return (String) getArg(pos, String.class, "string", def); *************** *** 79,86 **** --- 120,137 ---- + /** + * Return a required argument as an int. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public int getInt(int pos) { return getRequiredArg(pos).__int__().getValue(); } + /** + * Return an optional argument as an int. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public int getInt(int pos, int def) { PyObject value = getOptionalArg(pos); *************** *** 91,98 **** --- 142,159 ---- + /** + * Return a required argument as a PyObject. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public PyObject getPyObject(int pos) { return getRequiredArg(pos); } + /** + * Return an optiona argument as a PyObject. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public PyObject getPyObject(int pos, PyObject def) { PyObject value = getOptionalArg(pos); *************** *** 102,105 **** --- 163,171 ---- } + /** + * Return the remaining arguments as a tuple. + * @param pos The position of the argument. First argument is + * numbered 0. + */ public PyObject getList(int pos) { int kws_start = args.length - kws.length; |