Source Code Cross Referenced for ColumnContainer.java in  » Workflow-Engines » JFolder » org » jfolder » workflow » 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 » Workflow Engines » JFolder » org.jfolder.workflow.query 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.workflow.query;
009:
010:        //base classes
011:        import java.util.ArrayList;
012:
013:        //project specific classes
014:
015:        //other classes
016:
017:        public class ColumnContainer {
018:
019:            private final static Integer APP_STRING = new Integer(1);
020:            private final static Integer SYS_STRING = new Integer(2);
021:            private final static Integer APP_DECIMAL = new Integer(3);
022:            private final static Integer SYS_DECIMAL = new Integer(4);
023:            private final static Integer APP_BOOLEAN = new Integer(5);
024:            private final static Integer SYS_BOOLEAN = new Integer(6);
025:            //
026:            public final static Integer AGG_COUNT = new Integer(-1);
027:            public final static Integer AGG_AVG = new Integer(-2);
028:            public final static Integer AGG_SUM = new Integer(-3);
029:            public final static Integer AGG_MIN = new Integer(-4);
030:            public final static Integer AGG_MAX = new Integer(-5);
031:
032:            private ArrayList types = null;
033:            private ArrayList names = null;
034:            private ArrayList funcs = null;
035:
036:            //creation functions
037:            private ColumnContainer() {
038:                this .types = new ArrayList();
039:                this .names = new ArrayList();
040:                this .funcs = new ArrayList();
041:            }
042:
043:            public final static ColumnContainer createColumnContainer() {
044:
045:                ColumnContainer outValue = new ColumnContainer();
046:                return outValue;
047:            }
048:
049:            //register functions
050:            public void registerCountAll() {
051:                this .names.add(null);
052:                this .types.add(null);
053:                this .funcs.add(AGG_COUNT);
054:            }
055:
056:            public void registerSystemString(String inName, String inFunction) {
057:                this .names.add(inName.toUpperCase());
058:                this .types.add(SYS_STRING);
059:                this .funcs.add(inFunction);
060:            }
061:
062:            public void registerSystemDecimal(String inName, String inFunction) {
063:                this .names.add(inName.toUpperCase());
064:                this .types.add(SYS_DECIMAL);
065:                this .funcs.add(inFunction);
066:            }
067:
068:            public void registerSystemBoolean(String inName, String inFunction) {
069:                this .names.add(inName.toUpperCase());
070:                this .types.add(SYS_BOOLEAN);
071:                this .funcs.add(inFunction);
072:            }
073:
074:            public void registerApplicationString(String inName,
075:                    String inFunction) {
076:                this .names.add(inName.toUpperCase());
077:                this .types.add(APP_STRING);
078:                this .funcs.add(inFunction);
079:            }
080:
081:            public void registerApplicationDecimal(String inName,
082:                    String inFunction) {
083:                this .names.add(inName.toUpperCase());
084:                this .types.add(APP_DECIMAL);
085:                this .funcs.add(inFunction);
086:            }
087:
088:            public void registerApplicationBoolean(String inName,
089:                    String inFunction) {
090:                this .names.add(inName.toUpperCase());
091:                this .types.add(APP_BOOLEAN);
092:                this .funcs.add(inFunction);
093:            }
094:
095:            //access functions
096:            public int getColumnCount() {
097:                return this .names.size();
098:            }
099:
100:            public String getColumnName(int inIndex) {
101:                return (String) this .names.get(inIndex);
102:            }
103:
104:            public boolean isSystemColumn(int inIndex) {
105:                Integer outValue = (Integer) this .types.get(inIndex);
106:                return (((outValue.intValue()) % 2) == 0);
107:            }
108:
109:            public boolean isStringColumn(int inIndex) {
110:                Integer outValue = (Integer) this .types.get(inIndex);
111:                return (outValue.equals(APP_STRING) || outValue
112:                        .equals(SYS_STRING));
113:            }
114:
115:            public boolean isDecimalColumn(int inIndex) {
116:                Integer outValue = (Integer) this .types.get(inIndex);
117:                return (outValue.equals(APP_DECIMAL) || outValue
118:                        .equals(SYS_DECIMAL));
119:            }
120:
121:            public boolean isBooleanColumn(int inIndex) {
122:                Integer outValue = (Integer) this .types.get(inIndex);
123:                return (outValue.equals(APP_BOOLEAN) || outValue
124:                        .equals(SYS_BOOLEAN));
125:            }
126:
127:            //locating functions
128:            public int[] getColumnIndexes(String inAttrName, int inAttrType,
129:                    int inAttrClass) {
130:
131:                int outValue[] = null;
132:                Integer columnType = null;
133:                ArrayList selectedColumns = new ArrayList();
134:
135:                if (inAttrType == BaseDBQueryVendor.SYSTEM
136:                        && inAttrClass == BaseDBQueryVendor.DECIMAL) {
137:                    columnType = SYS_DECIMAL;
138:                } else if (inAttrType == BaseDBQueryVendor.SYSTEM
139:                        && inAttrClass == BaseDBQueryVendor.BOOLEAN) {
140:                    columnType = SYS_BOOLEAN;
141:                } else if (inAttrType == BaseDBQueryVendor.SYSTEM
142:                        && inAttrClass == BaseDBQueryVendor.STRING) {
143:                    columnType = SYS_STRING;
144:                } else if (inAttrType == BaseDBQueryVendor.APPLICATION
145:                        && inAttrClass == BaseDBQueryVendor.DECIMAL) {
146:                    columnType = APP_DECIMAL;
147:                } else if (inAttrType == BaseDBQueryVendor.APPLICATION
148:                        && inAttrClass == BaseDBQueryVendor.BOOLEAN) {
149:                    columnType = APP_BOOLEAN;
150:                } else if (inAttrType == BaseDBQueryVendor.APPLICATION
151:                        && inAttrClass == BaseDBQueryVendor.STRING) {
152:                    columnType = APP_STRING;
153:                }
154:
155:                for (int i = 0; i < this .names.size(); i++) {
156:                    if (this .names.get(i).equals(inAttrName)
157:                            && this .types.get(i).equals(columnType)) {
158:                        selectedColumns.add(new Integer(i));
159:                    }
160:                }
161:
162:                outValue = new int[selectedColumns.size()];
163:                for (int i = 0; i < selectedColumns.size(); i++) {
164:                    outValue[i] = ((Integer) selectedColumns.get(i)).intValue();
165:                }
166:
167:                return outValue;
168:            }
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.