Source Code Cross Referenced for AggregateDefinition.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » sql » compile » 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 » Database DBMS » db derby 10.2 » org.apache.derby.impl.sql.compile 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:
03:           Derby - Class org.apache.derby.impl.sql.compile.AggregateDefinition
04:
05:           Licensed to the Apache Software Foundation (ASF) under one or more
06:           contributor license agreements.  See the NOTICE file distributed with
07:           this work for additional information regarding copyright ownership.
08:           The ASF licenses this file to you under the Apache License, Version 2.0
09:           (the "License"); you may not use this file except in compliance with
10:           the License.  You may obtain a copy of the License at
11:
12:              http://www.apache.org/licenses/LICENSE-2.0
13:
14:           Unless required by applicable law or agreed to in writing, software
15:           distributed under the License is distributed on an "AS IS" BASIS,
16:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17:           See the License for the specific language governing permissions and
18:           limitations under the License.
19:
20:         */
21:
22:        package org.apache.derby.impl.sql.compile;
23:
24:        import java.lang.StringBuffer;
25:        import org.apache.derby.catalog.TypeDescriptor;
26:        import java.sql.SQLException;
27:
28:        /**
29:         * An AggregateDefinition defines an aggregate.
30:         * 
31:         * It is used
32:         * by Cloudscape during query compilation to determine what 
33:         * Aggregator is used to aggregate a particular data type 
34:         * and what datatype the Aggregator will emit.  A single 
35:         * AggregateDefinition may map to one or more Aggregators 
36:         * depending on the input type.  For example, a user defined
37:         * STDEV aggregate may use one aggregator implementation for the
38:         * INTEGER type and another for a user defined type that implements 
39:         * a point.  In this case, both the aggregators would have a 
40:         * single AggregateDefinition that would chose the appropriate
41:         * aggregator based on the input type.  On the other hand, if
42:         * only a single aggregator is needed to aggregate over all
43:         * of the input types (e.g. COUNT()), then it may be convenient
44:         * to implement both the AggregateDefinition and the Aggregator
45:         * interfaces by the same class.
46:         *
47:         * @see org.apache.derby.catalog.TypeDescriptor
48:         */
49:        interface AggregateDefinition {
50:            /**
51:             * Get the aggregator that performs the aggregation on the
52:             * input datatype at execution time.  If the input type can be handled, 
53:             * return a type descriptor with the resultant type information and
54:             * fill in the string buffer with the name of the class that
55:             * is used to perform the aggregation over the input type.
56:             * If the aggregate cannot be performed on this type, then
57:             * a null should be returned.
58:             * <p>
59:             * The aggregator class must implement a zero argument 
60:             * constructor.  The aggregator class can be the same class
61:             * as the AggregateDefinition if it implements both interfaces.
62:             * <p>
63:             * The result datatype may be the same as the input datatype 
64:             * or a different datatype.  To create your own type descriptor
65:             * to return to this method, see <i>com.ibm.db2j.types.TypeFactory</i>.
66:             *
67:             * @param inputType	the input type descriptor
68:             * @param aggregatorClassName	output parameter, filled in
69:             *		with the class name that implements <i>com.ibm.db2j.aggregates.Aggregator</i>
70:             *
71:             * @return the output type descriptor (which may or may not
72:             *		be the same as the input type -- it is ok to simply
73:             *		return the input type).  Null is returned
74:             *		if the aggregate cannot process the input type.
75:             *		Note that the output type may be a type that maps
76:             * 		directly to a standard SQL (e.g. <i>java.lang.Integer</i>)
77:             *		or any other java type (e.g. <i>java.sql.ResultSet</i>,
78:             *		<i>java.util.Vector</i>, <i>java.util.TimeZone</i> or whatever).
79:             *		To construct a type descriptor see <i>com.ibm.db2j.types.TypeFactory</i>.
80:             *
81:             * @see org.apache.derby.catalog.TypeDescriptor
82:             *
83:             * @exception SQLException Thrown on error.
84:             */
85:            public TypeDescriptor getAggregator(TypeDescriptor inputType,
86:                    StringBuffer aggregatorClassName) throws SQLException;
87:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.