Source Code Cross Referenced for Substring.java in  » Content-Management-System » harmonise » org » openharmonise » commons » dsi » dml » functions » 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 » Content Management System » harmonise » org.openharmonise.commons.dsi.dml.functions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.commons.dsi.dml.functions;
020:
021:        import org.openharmonise.commons.dsi.*;
022:        import org.openharmonise.commons.dsi.dml.*;
023:
024:        /**
025:         * This class represents a SQL 'substring' function, storing the pertinent data so that
026:         * the data store interface implementation can then create the correct function call.
027:         * 
028:         * @author Michael Bell
029:         * @version $Revision: 1.1 $
030:         *
031:         */
032:        public class Substring implements  Function {
033:
034:            /**
035:             * The start index
036:             */
037:            private Object m_objStart = null;
038:
039:            /**
040:             * The finish index
041:             */
042:            private Object m_objFinish = null;
043:
044:            /**
045:             * The string to be substringed
046:             */
047:            private String m_sString = null;
048:
049:            /**
050:             * Constructs a representation of the substring function which start the 
051:             * substring at <code>nStart</code> and finish the substring at <code>nFinish</code>.
052:             * 
053:             * @param sString the string
054:             * @param nStart the start index
055:             * @param nFinish the finish index
056:             */
057:            public Substring(String sString, int nStart, int nFinish) {
058:                m_objStart = new Integer(nStart);
059:                m_objFinish = new Integer(nFinish);
060:                m_sString = sString;
061:            }
062:
063:            /**
064:             * Constructs a representation of the substring function which start the 
065:             * substring at the result of processing <code>objStart</code> and finish
066:             * the substring at the result of processing <code>objFinish</code>. The 
067:             * start and finish parameters may be <code>Integer</code>, <code>Function</code>,
068:             * or <code>String</code> values.
069:             * 
070:             * @param sString the string
071:             * @param objStart the object which defines the start index
072:             * @param objFinish the object which defines the finish index
073:             * @throws DataStoreException if either the start or finish values are invalid
074:             */
075:            public Substring(String sString, Object objStart, Object objFinish)
076:                    throws DataStoreException {
077:
078:                if ((objStart instanceof  Integer) == false
079:                        && (objStart instanceof  Function) == false
080:                        && (objStart instanceof  String) == false) {
081:                    throw new DataStoreException("Start value invalid");
082:                }
083:
084:                if ((objFinish instanceof  Integer) == false
085:                        && (objFinish instanceof  Function) == false
086:                        && (objFinish instanceof  String) == false) {
087:                    throw new DataStoreException("Finish value invalid");
088:                }
089:
090:                m_objStart = objStart;
091:                m_objFinish = objFinish;
092:                m_sString = sString;
093:            }
094:
095:            /**
096:             * Returns the index of where the substring should start as an <code>Integer</code>
097:             * or a <code>Function</code>.
098:             * 
099:             * @return the index of where the substring should start 
100:             */
101:            public Object getStart() {
102:                return m_objStart;
103:            }
104:
105:            /**
106:             * Returns the index of where the substring should end as an <code>Integer</code>
107:             * or a <code>Function</code>.
108:             * 
109:             * @return the index of where the substring should end
110:             */
111:            public Object getFinish() {
112:                return m_objFinish;
113:            }
114:
115:            /**
116:             * Returns the <code>String</code> to be used in substring function.
117:             * 
118:             * @return the <code>String</code> to be used in substring function
119:             */
120:            public String getString() {
121:                return m_sString;
122:            }
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.