Source Code Cross Referenced for Function.java in  » Database-DBMS » mckoi » com » mckoi » database » 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 » mckoi » com.mckoi.database 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /**
02:         * com.mckoi.database.Function  11 Jul 2000
03:         *
04:         * Mckoi SQL Database ( http://www.mckoi.com/database )
05:         * Copyright (C) 2000, 2001, 2002  Diehl and Associates, Inc.
06:         *
07:         * This program is free software; you can redistribute it and/or
08:         * modify it under the terms of the GNU General Public License
09:         * Version 2 as published by the Free Software Foundation.
10:         *
11:         * This program is distributed in the hope that it will be useful,
12:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
13:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14:         * GNU General Public License Version 2 for more details.
15:         *
16:         * You should have received a copy of the GNU General Public License
17:         * Version 2 along with this program; if not, write to the Free Software
18:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19:         *
20:         * Change Log:
21:         * 
22:         * 
23:         */package com.mckoi.database;
24:
25:        import java.util.List;
26:
27:        /**
28:         * Represents a function that is part of an expression to be evaluated.  A
29:         * function evaluates to a resultant Object.  If the parameters of a function
30:         * are not constant values, then the evaluation will require a lookup via a
31:         * VariableResolver or GroupResolver.  The GroupResolver helps evaluate an
32:         * aggregate function.
33:         *
34:         * @author Tobias Downer
35:         */
36:
37:        public interface Function {
38:
39:            /**
40:             * Returns the name of the function.  The name is a unique identifier that
41:             * can be used to recreate this function.  This identifier can be used to
42:             * easily serialize the function when grouped with its parameters.
43:             */
44:            public String getName();
45:
46:            /**
47:             * Returns the list of Variable objects that this function uses as its
48:             * parameters.  If this returns an empty list, then the function must
49:             * only have constant parameters.  This information can be used to optimize
50:             * evaluation because if all the parameters of a function are constant then
51:             * we only need to evaluate the function once.
52:             */
53:            public List allVariables();
54:
55:            /**
56:             * Returns the list of all element objects that this function uses as its
57:             * parameters.  If this returns an empty list, then the function has no
58:             * input elements at all.  ( something like: upper(user()) )
59:             */
60:            public List allElements();
61:
62:            /**
63:             * Returns true if this function is an aggregate function.  An aggregate
64:             * function requires that the GroupResolver is not null when the evaluate
65:             * method is called.
66:             */
67:            public boolean isAggregate(QueryContext context);
68:
69:            /**
70:             * Prepares the exressions that are the parameters of this function.  This
71:             * is intended to be used if we need to resolve aspects such as Variable
72:             * references.  For example, a variable reference to 'number' may become
73:             * 'APP.Table.NUMBER'.
74:             */
75:            public void prepareParameters(ExpressionPreparer preparer)
76:                    throws DatabaseException;
77:
78:            /**
79:             * Evaluates the function and returns a TObject that represents the result
80:             * of the function.  The VariableResolver object should be used to look
81:             * up variables in the parameter of the function.  The 'FunctionTable'
82:             * object should only be used when the function is a grouping function.  For
83:             * example, 'avg(value_of)'.
84:             */
85:            public TObject evaluate(GroupResolver group,
86:                    VariableResolver resolver, QueryContext context);
87:
88:            /**
89:             * The type of object this function returns.  eg. TStringType,
90:             * TBooleanType, etc.  The VariableResolver points to a dummy row that can
91:             * be used to dynamically determine the return type.  For example, an
92:             * implementation of SQL 'GREATEST' would return the same type as the
93:             * list elements.
94:             */
95:            public TType returnTType(VariableResolver resolver,
96:                    QueryContext context);
97:
98:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.