Source Code Cross Referenced for UnaryOperation.java in  » XML » xalan » org » apache » xpath » operations » 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 » XML » xalan » org.apache.xpath.operations 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: UnaryOperation.java,v 1.14 2005/01/23 01:08:22 mcnamara Exp $
018:         */
019:        package org.apache.xpath.operations;
020:
021:        import org.apache.xpath.Expression;
022:        import org.apache.xpath.ExpressionOwner;
023:        import org.apache.xpath.XPathContext;
024:        import org.apache.xpath.XPathVisitor;
025:        import org.apache.xpath.objects.XObject;
026:
027:        /**
028:         * The unary operation base class.
029:         */
030:        public abstract class UnaryOperation extends Expression implements 
031:                ExpressionOwner {
032:            static final long serialVersionUID = 6536083808424286166L;
033:
034:            /** The operand for the operation.
035:             *  @serial */
036:            protected Expression m_right;
037:
038:            /**
039:             * This function is used to fixup variables from QNames to stack frame 
040:             * indexes at stylesheet build time.
041:             * @param vars List of QNames that correspond to variables.  This list 
042:             * should be searched backwards for the first qualified name that 
043:             * corresponds to the variable reference qname.  The position of the 
044:             * QName in the vector from the start of the vector will be its position 
045:             * in the stack frame (but variables above the globalsTop value will need 
046:             * to be offset to the current stack frame).
047:             */
048:            public void fixupVariables(java.util.Vector vars, int globalsSize) {
049:                m_right.fixupVariables(vars, globalsSize);
050:            }
051:
052:            /**
053:             * Tell if this expression or it's subexpressions can traverse outside
054:             * the current subtree.
055:             *
056:             * @return true if traversal outside the context node's subtree can occur.
057:             */
058:            public boolean canTraverseOutsideSubtree() {
059:
060:                if (null != m_right && m_right.canTraverseOutsideSubtree())
061:                    return true;
062:
063:                return false;
064:            }
065:
066:            /**
067:             * Set the expression operand for the operation.
068:             *
069:             *
070:             * @param r The expression operand to which the unary operation will be 
071:             *          applied.
072:             */
073:            public void setRight(Expression r) {
074:                m_right = r;
075:                r.exprSetParent(this );
076:            }
077:
078:            /**
079:             * Execute the operand and apply the unary operation to the result.
080:             *
081:             *
082:             * @param xctxt The runtime execution context.
083:             *
084:             * @return An XObject that represents the result of applying the unary 
085:             *         operation to the evaluated operand.
086:             *
087:             * @throws javax.xml.transform.TransformerException
088:             */
089:            public XObject execute(XPathContext xctxt)
090:                    throws javax.xml.transform.TransformerException {
091:
092:                return operate(m_right.execute(xctxt));
093:            }
094:
095:            /**
096:             * Apply the operation to two operands, and return the result.
097:             *
098:             *
099:             * @param right non-null reference to the evaluated right operand.
100:             *
101:             * @return non-null reference to the XObject that represents the result of the operation.
102:             *
103:             * @throws javax.xml.transform.TransformerException
104:             */
105:            public abstract XObject operate(XObject right)
106:                    throws javax.xml.transform.TransformerException;
107:
108:            /** @return the operand of unary operation, as an Expression.
109:             */
110:            public Expression getOperand() {
111:                return m_right;
112:            }
113:
114:            /**
115:             * @see org.apache.xpath.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
116:             */
117:            public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) {
118:                if (visitor.visitUnaryOperation(owner, this )) {
119:                    m_right.callVisitors(this , visitor);
120:                }
121:            }
122:
123:            /**
124:             * @see ExpressionOwner#getExpression()
125:             */
126:            public Expression getExpression() {
127:                return m_right;
128:            }
129:
130:            /**
131:             * @see ExpressionOwner#setExpression(Expression)
132:             */
133:            public void setExpression(Expression exp) {
134:                exp.exprSetParent(this );
135:                m_right = exp;
136:            }
137:
138:            /**
139:             * @see Expression#deepEquals(Expression)
140:             */
141:            public boolean deepEquals(Expression expr) {
142:                if (!isSameClass(expr))
143:                    return false;
144:
145:                if (!m_right.deepEquals(((UnaryOperation) expr).m_right))
146:                    return false;
147:
148:                return true;
149:            }
150:
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.