Source Code Cross Referenced for FSFastExtension.java in  » Scripting » FScript » murlen » util » fscript » 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 » FScript » murlen.util.fscript 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package murlen.util.fscript;
002:
003:        import java.util.ArrayList;
004:        import java.util.Hashtable;
005:
006:        /**
007:         * <p>FastExtension - general extension in which other (simple) extensions
008:         * can be plugged.
009:         * </p>
010:         * <p>
011:         * <I>Copyright (C) 2002 </I></p>
012:         * <p>
013:         * This library is free software; you can redistribute it and/or
014:         * modify it under the terms of the GNU Library General Public
015:         * License as published by the Free Software Foundation; either
016:         * version 2 of the License, or (at your option) any later version.</p>
017:         * <p>
018:         * This library is distributed in the hope that it will be useful,
019:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
020:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
021:         * Library General Public License for more details.</p>
022:         *
023:         * <p>You should have received a copy of the GNU Library General Public
024:         * License along with this library; if not, write to the Free
025:         * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA </p>
026:         *
027:         * @author Joachim Van der Auwera
028:         *
029:         * modifications by Joachim Van der Auwera
030:         * 02.08.2002 started
031:         *
032:         * 11.08.2002 (murlen) Changed function names to add<X>Extension + java doc
033:         */
034:        public class FSFastExtension implements  FSExtension {
035:            Hashtable variables = new Hashtable();
036:            Hashtable functions = new Hashtable();
037:            Hashtable arrays = new Hashtable();
038:
039:            /**
040:             * Add new FSVarExtension to this FastExtension
041:             * @param name - the name of the variable (must be unique amongst varables)
042:             * @param var - the FSVarExtension object implementing the varaible
043:             */
044:            public void addVarExtension(String name, FSVarExtension var) {
045:                variables.put(name, var);
046:            }
047:
048:            /**
049:             * Add new FSArrayExtension to this FastExtension
050:             * @param name - the name of the array (must be unique amongst arrays)
051:             * @param array - the FSArrayExtension object implementing the array
052:             */
053:            public void addArrayExtension(String name, FSArrayExtension array) {
054:                arrays.put(name, array);
055:            }
056:
057:            /**
058:             * Add new FSFunctionExtension to this FastExtension
059:             * @param name - the name of the function (must be unique amongs functions)
060:             * @param fnc - the FSFunctionExtension object implementing the function
061:             */
062:            public void addFunctionExtension(String name,
063:                    FSFunctionExtension fnc) {
064:                functions.put(name, fnc);
065:            }
066:
067:            public Object getVar(String name) throws FSException {
068:                FSVarExtension var = (FSVarExtension) variables.get(name);
069:                if (var != null)
070:                    return var.getVar(name);
071:                throw new FSUnsupportedException();
072:            }
073:
074:            //FSExtension implementation code below here.
075:
076:            public void setVar(String name, Object value) throws FSException {
077:                FSVarExtension var = (FSVarExtension) variables.get(name);
078:                if (var != null) {
079:                    var.setVar(name, value);
080:                    return;
081:                }
082:                throw new FSUnsupportedException();
083:            }
084:
085:            public Object getVar(String name, Object index) throws FSException {
086:                FSArrayExtension var = (FSArrayExtension) arrays.get(name);
087:                if (var != null)
088:                    return var.getVar(name, index);
089:                throw new FSUnsupportedException();
090:            }
091:
092:            public void setVar(String name, Object index, Object value)
093:                    throws FSException {
094:                FSArrayExtension var = (FSArrayExtension) arrays.get(name);
095:                if (var != null) {
096:                    var.setVar(name, index, value);
097:                    return;
098:                }
099:                throw new FSUnsupportedException();
100:            }
101:
102:            public Object callFunction(String name, ArrayList params)
103:                    throws FSException {
104:                FSFunctionExtension var = (FSFunctionExtension) functions
105:                        .get(name);
106:                if (var != null)
107:                    return var.callFunction(name, params);
108:                throw new FSUnsupportedException();
109:            }
110:
111:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.