01: /*
02: * JavaIsNullCmd.java --
03: *
04: * This class implements the built-in "java::isnull" command in Tcl.
05: *
06: * Copyright (c) 1998 by Sun Microsystems, Inc.
07: *
08: * See the file "license.terms" for information on usage and redistribution
09: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10: *
11: * RCS: @(#) $Id: JavaIsNullCmd.java,v 1.1.1.1 1998/10/14 21:09:14 cvsadmin Exp $
12: */
13:
14: package tcl.lang;
15:
16: class JavaIsNullCmd implements Command {
17:
18: /*
19: *----------------------------------------------------------------------
20: *
21: * cmdProc --
22: *
23: * This procedure is invoked to process the "java::isnull" Tcl
24: * command. See the user documentation for details on what it
25: * does.
26: *
27: * Results:
28: * None.
29: *
30: * Side effects:
31: * A standard Tcl result is stored in the interpreter.
32: *
33: *----------------------------------------------------------------------
34: */
35:
36: public void cmdProc(Interp interp, // The current interpreter.
37: TclObject argv[]) // The command arguments.
38: throws TclException // Standard Tcl Exception.
39: {
40: if (argv.length != 2) {
41: throw new TclNumArgsException(interp, 1, argv, "object");
42: }
43:
44: Object obj = null;
45:
46: obj = ReflectObject.get(interp, argv[1]);
47:
48: if (obj == null) {
49: interp.setResult(true);
50: } else {
51: interp.setResult(false);
52: }
53: }
54:
55: } // end JavaIsNullCmd
|