Source Code Cross Referenced for WrappedCommand.java in  » Scripting » jacl » tcl » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » jacl » tcl.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * WrappedCommand.java
03:         *
04:         *	Wrapper for commands located inside a Jacl interp.
05:         *
06:         * Copyright (c) 1999 Mo DeJong.
07:         *
08:         * See the file "license.terms" for information on usage and
09:         * redistribution of this file, and for a DISCLAIMER OF ALL
10:         * WARRANTIES.
11:         * 
12:         * RCS: @(#) $Id: WrappedCommand.java,v 1.6 2006/01/26 19:49:18 mdejong Exp $
13:         */
14:
15:        package tcl.lang;
16:
17:        import java.util.*;
18:
19:        /**
20:         * A Wrapped Command is like the Command struct defined in the C version
21:         * in the file generic/tclInt.h. It is "wrapped" around a TclJava Command
22:         * interface reference. We need to wrap Command references so that we
23:         * can keep track of sticky issues like what namespace the command is
24:         * defined in without requiring that every implementation of a Command
25:         * interface provide method to do this. This class is only used in
26:         * the internal implementation of Jacl.
27:         */
28:
29:        public class WrappedCommand {
30:            public HashMap table; // Reference to the table that this command is
31:            // defined inside. The hashKey member can be
32:            // used to lookup this WrappedCommand instance
33:            // in the table of WrappedCommands. The table
34:            // member combined with the hashKey member are
35:            // are equivilent to the C version's Command->hPtr.
36:            public String hashKey; // A string that stores the name of the command.
37:            // This name is NOT fully qualified.
38:
39:            public Namespace ns; // The namespace where the command is located
40:
41:            public Command cmd; // The actual Command interface that we are wrapping.
42:
43:            public boolean deleted; // Means that the command is in the process
44:            // of being deleted. Other attempts to
45:            // delete the command should be ignored.
46:
47:            ImportRef importRef; // List of each imported Command created in
48:            // another namespace when this command is
49:            // imported. These imported commands
50:            // redirect invocations back to this
51:            // command. The list is used to remove all
52:            // those imported commands when deleting
53:            // this "real" command.
54:
55:            public int cmdEpoch; // Incremented to invalidate any references
56:
57:            // that point to this command when it is
58:            // renamed, deleted, hidden, or exposed.
59:            // This field always have a value in the
60:            // range 1 to Integer.MAX_VALUE (inclusive).
61:            // User code should NEVER modify this value.
62:
63:            // Increment the cmdProch field. This method is used by the interpreter
64:            // to indicate that a command was hidden, renamed, or deleted.
65:
66:            void incrEpoch() {
67:                cmdEpoch++;
68:                if (cmdEpoch == Integer.MIN_VALUE) {
69:                    // Integer overflow, really unlikely but possible.
70:                    cmdEpoch = 1;
71:                }
72:            }
73:
74:            public String toString() {
75:                StringBuffer sb = new StringBuffer();
76:
77:                sb.append("Wrapper for ");
78:                if (ns != null) {
79:                    sb.append(ns.fullName);
80:                    if (!ns.fullName.equals("::")) {
81:                        sb.append("::");
82:                    }
83:                }
84:                if (table != null) {
85:                    sb.append(hashKey);
86:                }
87:
88:                sb.append(" -> ");
89:                sb.append(cmd.getClass().getName());
90:
91:                sb.append(" cmdEpoch is ");
92:                sb.append(cmdEpoch);
93:
94:                return sb.toString();
95:            }
96:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.