Source Code Cross Referenced for EmptySequence.java in  » XML » saxonb » net » sf » saxon » value » 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 » saxonb » net.sf.saxon.value 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sf.saxon.value;
002:
003:        import net.sf.saxon.expr.ExpressionTool;
004:        import net.sf.saxon.expr.StaticProperty;
005:        import net.sf.saxon.expr.XPathContext;
006:        import net.sf.saxon.om.EmptyIterator;
007:        import net.sf.saxon.om.NamePool;
008:        import net.sf.saxon.om.SequenceIterator;
009:        import net.sf.saxon.pattern.NoNodeTest;
010:        import net.sf.saxon.type.ItemType;
011:        import net.sf.saxon.type.TypeHierarchy;
012:
013:        import java.io.PrintStream;
014:
015:        /**
016:         * An EmptySequence object represents a sequence containing no members.
017:         */
018:
019:        public final class EmptySequence extends Value {
020:
021:            // This class has a single instance
022:            private static EmptySequence THE_INSTANCE = new EmptySequence();
023:
024:            /**
025:             * Private constructor: only the predefined instances of this class can be used
026:             */
027:
028:            private EmptySequence() {
029:            }
030:
031:            /**
032:             * Get the implicit instance of this class
033:             */
034:
035:            public static EmptySequence getInstance() {
036:                return THE_INSTANCE;
037:            }
038:
039:            /**
040:             * An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
041:             * This method indicates which of these methods is prefered.
042:             */
043:
044:            public int getImplementationMethod() {
045:                return EVALUATE_METHOD;
046:            }
047:
048:            /**
049:             * Return an iteration over the sequence
050:             */
051:
052:            public SequenceIterator iterate(XPathContext context) {
053:                return EmptyIterator.getInstance();
054:            }
055:
056:            /**
057:             * Determine the item type
058:             * @param th
059:             */
060:
061:            public ItemType getItemType(TypeHierarchy th) {
062:                return NoNodeTest.getInstance();
063:            }
064:
065:            /**
066:             * Determine the static cardinality
067:             */
068:
069:            public int getCardinality() {
070:                return StaticProperty.EMPTY;
071:            }
072:
073:            /**
074:             * Get the static properties of this expression (other than its type). The result is
075:             * bit-signficant. These properties are used for optimizations. In general, if
076:             * property bit is set, it is true, but if it is unset, the value is unknown.
077:             */
078:
079:            public int getSpecialProperties() {
080:                return StaticProperty.ORDERED_NODESET
081:                        | StaticProperty.SINGLE_DOCUMENT_NODESET
082:                        | StaticProperty.CONTEXT_DOCUMENT_NODESET;
083:            }
084:
085:            /**
086:             * Get the length of the sequence
087:             * @return always 0 for an empty sequence
088:             */
089:
090:            public final int getLength() {
091:                return 0;
092:            }
093:
094:            /**
095:             * Is this expression the same as another expression?
096:             * @throws ClassCastException if the values are not comparable
097:             */
098:
099:            public boolean equals(Object other) {
100:                if (!(other instanceof  EmptySequence)) {
101:                    throw new ClassCastException("Cannot compare "
102:                            + other.getClass() + " to empty sequence");
103:                }
104:                return true;
105:            }
106:
107:            public int hashCode() {
108:                return 42;
109:            }
110:
111:            /**
112:             * Evaluate as a string. Returns the string value of the first value in the sequence
113:             * @return "" always
114:             */
115:
116:            //    public String getStringValue() throws XPathException {
117:            //        return "";
118:            //    }
119:            /**
120:             * Get the effective boolean value - always false
121:             */
122:
123:            public boolean effectiveBooleanValue(XPathContext context) {
124:                return false;
125:            }
126:
127:            /**
128:             * Diagnostic print of expression structure
129:             */
130:
131:            public void display(int level, NamePool pool, PrintStream out) {
132:                out.println(ExpressionTool.indent(level) + "()");
133:            }
134:
135:        }
136:
137:        //
138:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
139:        // you may not use this file except in compliance with the License. You may obtain a copy of the
140:        // License at http://www.mozilla.org/MPL/
141:        //
142:        // Software distributed under the License is distributed on an "AS IS" basis,
143:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
144:        // See the License for the specific language governing rights and limitations under the License.
145:        //
146:        // The Original Code is: all this file.
147:        //
148:        // The Initial Developer of the Original Code is Michael H. Kay.
149:        //
150:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
151:        //
152:        // Contributor(s): none.
153:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.