Source Code Cross Referenced for BuiltinRegistry.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » rulesys » 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 » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.reasoner.rulesys 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************
002:         * File:        BuildinRegistry.java
003:         * Created by:  Dave Reynolds
004:         * Created on:  11-Apr-2003
005:         * 
006:         * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
007:         * [See end of file]
008:         * $Id: BuiltinRegistry.java,v 1.26 2008/01/02 12:07:46 andy_seaborne Exp $
009:         *****************************************************************/package com.hp.hpl.jena.reasoner.rulesys;
010:
011:        import com.hp.hpl.jena.reasoner.rulesys.builtins.*;
012:        import java.util.*;
013:
014:        /** * A registry for mapping functor names on java objects (instances 
015:         * of subclasses of Builtin) which implement their behvaiour.
016:         * <p>
017:         * This is currently implemented as a singleton to simply any future
018:         * move to support different sets of builtins.
019:         * 
020:         * @see Builtin * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a> * @version $Revision: 1.26 $ on $Date: 2008/01/02 12:07:46 $ */
021:        public class BuiltinRegistry {
022:
023:            /** The single global static registry */
024:            public static BuiltinRegistry theRegistry;
025:
026:            /** Mapping from functor name to Builtin implementing it */
027:            protected Map builtins = new HashMap();
028:
029:            /** Mapping from URI of builtin to implementation */
030:            protected Map builtinsByURI = new HashMap();
031:
032:            // Static initilizer for the singleton instance
033:            static {
034:                theRegistry = new BuiltinRegistry();
035:
036:                theRegistry.register(new Print());
037:                theRegistry.register(new AddOne());
038:                theRegistry.register(new LessThan());
039:                theRegistry.register(new GreaterThan());
040:                theRegistry.register(new LE());
041:                theRegistry.register(new GE());
042:                theRegistry.register(new Equal());
043:                theRegistry.register(new NotFunctor());
044:                theRegistry.register(new IsFunctor());
045:                theRegistry.register(new NotEqual());
046:                theRegistry.register(new MakeTemp());
047:                theRegistry.register(new NoValue());
048:                theRegistry.register(new Remove());
049:                theRegistry.register(new Drop());
050:                theRegistry.register(new Sum());
051:                theRegistry.register(new Difference());
052:                theRegistry.register(new Product());
053:                theRegistry.register(new Quotient());
054:                theRegistry.register(new Bound());
055:                theRegistry.register(new Unbound());
056:                theRegistry.register(new IsLiteral());
057:                theRegistry.register(new NotLiteral());
058:                theRegistry.register(new IsBNode());
059:                theRegistry.register(new NotBNode());
060:                theRegistry.register(new IsDType());
061:                theRegistry.register(new NotDType());
062:                theRegistry.register(new CountLiteralValues());
063:                theRegistry.register(new Max());
064:                theRegistry.register(new Min());
065:                theRegistry.register(new ListLength());
066:                theRegistry.register(new ListEntry());
067:                theRegistry.register(new ListEqual());
068:                theRegistry.register(new ListNotEqual());
069:                theRegistry.register(new ListContains());
070:                theRegistry.register(new ListNotContains());
071:                theRegistry.register(new ListMapAsSubject());
072:                theRegistry.register(new ListMapAsObject());
073:
074:                theRegistry.register(new MakeInstance());
075:                theRegistry.register(new Table());
076:                theRegistry.register(new TableAll());
077:
078:                theRegistry.register(new Hide());
079:
080:                theRegistry.register(new StrConcat());
081:                theRegistry.register(new UriConcat());
082:                theRegistry.register(new Regex());
083:
084:                theRegistry.register(new Now());
085:
086:                // Special purposes support functions for OWL
087:                theRegistry.register(new AssertDisjointPairs());
088:            }
089:
090:            /**
091:             * Construct an empty registry
092:             */
093:            public BuiltinRegistry() {
094:            }
095:
096:            /**
097:             * Register an implementation for a given builtin functor.
098:             * @param functor the name of the functor used to invoke the builtin
099:             * @param impl the implementation of the builtin
100:             */
101:            public void register(String functor, Builtin impl) {
102:                builtins.put(functor, impl);
103:                builtinsByURI.put(impl.getURI(), impl);
104:            }
105:
106:            /**
107:             * Register an implementation for a given builtin using its default name.
108:             * @param impl the implementation of the builtin
109:             */
110:            public void register(Builtin impl) {
111:                builtins.put(impl.getName(), impl);
112:                builtinsByURI.put(impl.getURI(), impl);
113:            }
114:
115:            /**
116:             * Find the implementation of the given builtin functor.
117:             * @param functor the name of the functor being invoked.
118:             * @return a Builtin or null if there is none registered under that name
119:             */
120:            public Builtin getImplementation(String functor) {
121:                return (Builtin) builtins.get(functor);
122:            }
123:
124:            /**
125:             * Find the implementation of the given builtin functor.
126:             * @param uri the URI of the builtin to be retrieved
127:             * @return a Builtin or null if there is none registered under that name
128:             */
129:            public Builtin getImplementationByURI(String uri) {
130:                return (Builtin) builtinsByURI.get(uri);
131:            }
132:
133:        }
134:
135:        /*
136:         (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
137:         All rights reserved.
138:
139:         Redistribution and use in source and binary forms, with or without
140:         modification, are permitted provided that the following conditions
141:         are met:
142:
143:         1. Redistributions of source code must retain the above copyright
144:         notice, this list of conditions and the following disclaimer.
145:
146:         2. Redistributions in binary form must reproduce the above copyright
147:         notice, this list of conditions and the following disclaimer in the
148:         documentation and/or other materials provided with the distribution.
149:
150:         3. The name of the author may not be used to endorse or promote products
151:         derived from this software without specific prior written permission.
152:
153:         THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
154:         IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
155:         OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
156:         IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
157:         INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
158:         NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
159:         DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
160:         THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
161:         (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
162:         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
163:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.