Source Code Cross Referenced for DataRowConnector.java in  » Report » pentaho-report » org » jfree » report » states » 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 » Report » pentaho report » org.jfree.report.states 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * ===========================================
003:         * JFreeReport : a free Java reporting library
004:         * ===========================================
005:         *
006:         * Project Info:  http://reporting.pentaho.org/
007:         *
008:         * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009:         *
010:         * This library is free software; you can redistribute it and/or modify it under the terms
011:         * of the GNU Lesser General Public License as published by the Free Software Foundation;
012:         * either version 2.1 of the License, or (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015:         * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016:         * See the GNU Lesser General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU Lesser General Public License along with this
019:         * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020:         * Boston, MA 02111-1307, USA.
021:         *
022:         * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023:         * in the United States and other countries.]
024:         *
025:         * ------------
026:         * DataRowConnector.java
027:         * ------------
028:         * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029:         */package org.jfree.report.states;
030:
031:        import org.jfree.report.DataRow;
032:        import org.jfree.report.filter.DataSource;
033:        import org.jfree.report.filter.DataTarget;
034:
035:        /**
036:         * This is the connection-proxy to the various data sources contained in the elements.
037:         * During report processing the report states get cloned while the elements remain
038:         * uncloned. The DataRowConnector connects the DataRowBackend (which contains the data)
039:         * with the stateless elements.
040:         *
041:         * @author Thomas Morgner
042:         */
043:        public class DataRowConnector implements  DataRow {
044:            /**
045:             * The data row backend.
046:             */
047:            private DataRow dataRow;
048:
049:            /**
050:             * Default constructor.
051:             */
052:            public DataRowConnector() {
053:            }
054:
055:            /**
056:             * Returns the assigned data row backend.
057:             *
058:             * @return the currently assigned DataRowBackend for this DataRowConnector.
059:             */
060:            public DataRow getDataRowBackend() {
061:                return dataRow;
062:            }
063:
064:            /**
065:             * Sets the data row backend for this DataRowConnector. The backend actually contains
066:             * the data which will be queried, while this DataRowConnector is simply a proxy
067:             * forwarding all requests to the backend.
068:             *
069:             * @param dataRow the data row backend
070:             */
071:            public void setDataRowBackend(final DataRow dataRow) {
072:                this .dataRow = dataRow;
073:            }
074:
075:            /**
076:             * Return the value of the function, expression or column in the tablemodel using the
077:             * column number.
078:             *
079:             * @param col the column, function or expression index.
080:             * @return the column, function or expression value.
081:             *
082:             * @throws java.lang.IllegalStateException
083:             *          if there is no backend connected.
084:             */
085:            public Object get(final int col) {
086:                if (dataRow == null) {
087:                    throw new IllegalStateException("Not connected");
088:                }
089:                return dataRow.get(col);
090:            }
091:
092:            /**
093:             * Returns the value of the column, function or expression using its name.
094:             *
095:             * @param col the column, function or expression index.
096:             * @return The column, function or expression value.
097:             *
098:             * @throws java.lang.IllegalStateException
099:             *          if there is no backend connected
100:             */
101:            public Object get(final String col) {
102:                if (dataRow == null) {
103:                    throw new IllegalStateException("Not connected");
104:                }
105:                return dataRow.get(col);
106:            }
107:
108:            /**
109:             * Returns the name of the column, function or expression.
110:             *
111:             * @param col the column, function or expression index.
112:             * @return the column, function or expression name.
113:             *
114:             * @throws java.lang.IllegalStateException
115:             *          if there is no backend connected.
116:             */
117:            public String getColumnName(final int col) {
118:                if (dataRow == null) {
119:                    throw new IllegalStateException("Not connected");
120:                }
121:                return dataRow.getColumnName(col);
122:            }
123:
124:            /**
125:             * Looks up the position of the column with the name <code>name</code>. returns the
126:             * position of the column or -1 if no columns could be retrieved.
127:             *
128:             * @param name the column, function or expression name.
129:             * @return the column position of the column, expression or function with the given name
130:             *         or -1 if the given name does not exist in this DataRow.
131:             *
132:             * @throws java.lang.IllegalStateException
133:             *          if there is no backend connected.
134:             */
135:            public int findColumn(final String name) {
136:                if (dataRow == null) {
137:                    throw new IllegalStateException("Not connected");
138:                }
139:                return getDataRowBackend().findColumn(name);
140:            }
141:
142:            /**
143:             * Returns the count of columns in this datarow. The columncount is the sum of all
144:             * DataSource columns, all functions and all expressions.
145:             *
146:             * @return the number of accessible columns in this datarow.
147:             *
148:             * @throws java.lang.IllegalStateException
149:             *          if there is no backend connected.
150:             */
151:            public int getColumnCount() {
152:                if (dataRow == null) {
153:                    throw new IllegalStateException("Not connected");
154:                }
155:                return getDataRowBackend().getColumnCount();
156:            }
157:
158:            /**
159:             * Queries the last datasource in the chain of targets and filters.
160:             * <p/>
161:             * The last datasource is used to feed data into the data processing chain. The result
162:             * of this computation is retrieved by the element using the registered datasource to
163:             * query the queue.
164:             *
165:             * @param e the data target.
166:             * @return The last DataSource in the chain.
167:             * @deprecated no longer used.
168:             */
169:            public static DataSource getLastDatasource(final DataTarget e) {
170:                if (e == null) {
171:                    throw new NullPointerException();
172:                }
173:                DataSource s = e.getDataSource();
174:                while (s instanceof  DataTarget) {
175:                    final DataTarget tgt = (DataTarget) s;
176:                    s = tgt.getDataSource();
177:                }
178:                return s;
179:            }
180:
181:            /**
182:             * Returns a string describing the object.
183:             *
184:             * @return The string.
185:             */
186:            public String toString() {
187:                if (dataRow == null) {
188:                    return "org.jfree.report.states.DataRowConnector=Not Connected";
189:                }
190:                return "org.jfree.report.states.DataRowConnector=Connected:"
191:                        + dataRow;
192:
193:            }
194:
195:            public boolean isChanged(final String name) {
196:                return dataRow.isChanged(name);
197:            }
198:
199:            public boolean isChanged(final int index) {
200:                return dataRow.isChanged(index);
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.