Source Code Cross Referenced for QueryLanguage.java in  » RSS-RDF » sesame » org » openrdf » query » 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 » sesame » org.openrdf.query 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
003:         *
004:         * Licensed under the Aduna BSD-style license.
005:         */
006:        package org.openrdf.query;
007:
008:        import java.util.ArrayList;
009:        import java.util.Collection;
010:        import java.util.Collections;
011:        import java.util.List;
012:        import java.util.Locale;
013:
014:        /**
015:         * A type-safe enumeration for RDF query languages. QueryLanguage objects are
016:         * identified by their name, which is treated in as case-insensitive way.
017:         */
018:        public class QueryLanguage {
019:
020:            /*-----------*
021:             * Constants *
022:             *-----------*/
023:
024:            public static final QueryLanguage SERQL = new QueryLanguage("SeRQL");
025:
026:            public static final QueryLanguage SPARQL = new QueryLanguage(
027:                    "SPARQL");
028:
029:            public static final QueryLanguage SERQO = new QueryLanguage("SeRQO");
030:
031:            /*------------------*
032:             * Static variables *
033:             *------------------*/
034:
035:            /**
036:             * List of known query languages.
037:             */
038:            private static List<QueryLanguage> QUERY_LANGUAGES = new ArrayList<QueryLanguage>(
039:                    4);
040:
041:            /*--------------------*
042:             * Static initializer *
043:             *--------------------*/
044:
045:            static {
046:                register(SERQL);
047:                register(SPARQL);
048:                register(SERQO);
049:            }
050:
051:            /*----------------*
052:             * Static methods *
053:             *----------------*/
054:
055:            /**
056:             * Returns all known/registered query languages.
057:             */
058:            public static Collection<QueryLanguage> values() {
059:                return Collections.unmodifiableList(QUERY_LANGUAGES);
060:            }
061:
062:            /**
063:             * Registers the specified query language.
064:             * 
065:             * @param name
066:             *        The name of the query language, e.g. "SPARQL".
067:             */
068:            public static QueryLanguage register(String name) {
069:                QueryLanguage ql = new QueryLanguage(name);
070:                register(ql);
071:                return ql;
072:            }
073:
074:            /**
075:             * Registers the specified query language.
076:             */
077:            public static void register(QueryLanguage ql) {
078:                QUERY_LANGUAGES.add(ql);
079:            }
080:
081:            /**
082:             * Returns the query language whose name matches the specified name.
083:             * 
084:             * @param qlName
085:             *        A query language name.
086:             * @return The query language whose name matches the specified name, or
087:             *         <tt>null</tt> if there is no such query language.
088:             */
089:            public static QueryLanguage valueOf(String qlName) {
090:                for (QueryLanguage ql : QUERY_LANGUAGES) {
091:                    if (ql.getName().equalsIgnoreCase(qlName)) {
092:                        return ql;
093:                    }
094:                }
095:
096:                return null;
097:            }
098:
099:            /*-----------*
100:             * Variables *
101:             *-----------*/
102:
103:            /**
104:             * The query language's name.
105:             */
106:            private String name;
107:
108:            /*--------------*
109:             * Constructors *
110:             *--------------*/
111:
112:            /**
113:             * Creates a new QueryLanguage object.
114:             * 
115:             * @param name
116:             *        The (case-insensitive) name of the query language, e.g. "SPARQL".
117:             */
118:            public QueryLanguage(String name) {
119:                assert name != null : "name must not be null";
120:
121:                this .name = name;
122:            }
123:
124:            /*---------*
125:             * Methods *
126:             *---------*/
127:
128:            /**
129:             * Gets the name of this query language.
130:             * 
131:             * @return A human-readable format name, e.g. "SPARQL".
132:             */
133:            public String getName() {
134:                return name;
135:            }
136:
137:            public boolean hasName(String name) {
138:                return this .name.equalsIgnoreCase(name);
139:            }
140:
141:            @Override
142:            public boolean equals(Object other) {
143:                if (other instanceof  QueryLanguage) {
144:                    QueryLanguage o = (QueryLanguage) other;
145:                    return this .hasName(o.getName());
146:                }
147:
148:                return false;
149:            }
150:
151:            @Override
152:            public int hashCode() {
153:                return getName().toUpperCase(Locale.ENGLISH).hashCode();
154:            }
155:
156:            @Override
157:            public String toString() {
158:                return getName();
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.