01: /*
02: * LlengthCmd.java
03: *
04: * Copyright (c) 1997 Cornell University.
05: * Copyright (c) 1997 Sun Microsystems, Inc.
06: *
07: * See the file "license.terms" for information on usage and
08: * redistribution of this file, and for a DISCLAIMER OF ALL
09: * WARRANTIES.
10: *
11: * RCS: @(#) $Id: LlengthCmd.java,v 1.2 2005/10/07 06:50:09 mdejong Exp $
12: *
13: */
14:
15: package tcl.lang;
16:
17: import java.io.*;
18: import java.util.*;
19:
20: /**
21: * This class implements the built-in "llength" command in Tcl.
22: */
23:
24: class LlengthCmd implements Command {
25: /**
26: * See Tcl user documentation for details.
27: * @exception TclException If incorrect number of arguments.
28: */
29:
30: public void cmdProc(Interp interp, TclObject argv[])
31: throws TclException {
32: if (argv.length != 2) {
33: throw new TclNumArgsException(interp, 1, argv, "list");
34: }
35: interp.setResult(TclList.getLength(interp, argv[1]));
36: }
37: }
|