Source Code Cross Referenced for EmptyRange.java in  » Scripting » groovy-1.0 » groovy » lang » 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 » Scripting » groovy 1.0 » groovy.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package groovy.lang;
002:
003:        import org.codehaus.groovy.runtime.InvokerHelper;
004:
005:        import java.util.*;
006:
007:        /**
008:         * Constructing Ranges like 0..<0
009:         * @author Dierk Koenig
010:         */
011:        public class EmptyRange implements  Range {
012:            protected Comparable at = null;
013:            protected final List EMPTY_LIST = new ArrayList();
014:
015:            public EmptyRange(Comparable at) {
016:                this .at = at;
017:            }
018:
019:            public Comparable getFrom() {
020:                return at;
021:            }
022:
023:            public Comparable getTo() {
024:                return at;
025:            }
026:
027:            public boolean isReverse() {
028:                return false;
029:            }
030:
031:            public String inspect() {
032:                return InvokerHelper.inspect(at) + "..<"
033:                        + InvokerHelper.inspect(at);
034:            }
035:
036:            public String toString() {
037:                if (null == at)
038:                    return "null..<null";
039:                return at.toString() + "..<" + at.toString();
040:            }
041:
042:            public int size() {
043:                return 0;
044:            }
045:
046:            public void clear() {
047:            }
048:
049:            public boolean isEmpty() {
050:                return true;
051:            }
052:
053:            public Object[] toArray() {
054:                return new Object[0];
055:            }
056:
057:            public Object get(int index) {
058:                return null;
059:            }
060:
061:            public Object remove(int index) {
062:                return null;
063:            }
064:
065:            /**
066:             * @throws UnsupportedOperationException
067:             */
068:            public void add(int index, Object element) {
069:                throw new UnsupportedOperationException(
070:                        "cannot add to Empty Ranges");
071:            }
072:
073:            public int indexOf(Object o) {
074:                return -1;
075:            }
076:
077:            public int lastIndexOf(Object o) {
078:                return -1;
079:            }
080:
081:            /**
082:             * @throws UnsupportedOperationException
083:             */
084:            public boolean add(Object o) {
085:                throw new UnsupportedOperationException(
086:                        "cannot add to Empty Ranges");
087:            }
088:
089:            public boolean contains(Object o) {
090:                return false;
091:            }
092:
093:            public boolean remove(Object o) {
094:                return false;
095:            }
096:
097:            /**
098:             * @throws UnsupportedOperationException
099:             */
100:            public boolean addAll(int index, Collection c) {
101:                throw new UnsupportedOperationException(
102:                        "cannot add to Empty Ranges");
103:            }
104:
105:            /**
106:             * @throws UnsupportedOperationException
107:             */
108:            public boolean addAll(Collection c) {
109:                throw new UnsupportedOperationException(
110:                        "cannot add to Empty Ranges");
111:            }
112:
113:            public boolean containsAll(Collection c) {
114:                return false;
115:            }
116:
117:            public boolean removeAll(Collection c) {
118:                return false;
119:            }
120:
121:            public boolean retainAll(Collection c) {
122:                return false;
123:            }
124:
125:            public Iterator iterator() {
126:                return EMPTY_LIST.iterator();
127:            }
128:
129:            public List subList(int fromIndex, int toIndex) {
130:                return EMPTY_LIST.subList(fromIndex, toIndex);
131:            }
132:
133:            public ListIterator listIterator() {
134:                return EMPTY_LIST.listIterator();
135:            }
136:
137:            public ListIterator listIterator(int index) {
138:                return EMPTY_LIST.listIterator(index);
139:            }
140:
141:            /**
142:             * @throws UnsupportedOperationException
143:             */
144:            public Object set(int index, Object element) {
145:                throw new UnsupportedOperationException(
146:                        "cannot set in Empty Ranges");
147:            }
148:
149:            public Object[] toArray(Object a[]) {
150:                return new Object[0];
151:            }
152:
153:            public void step(int step, Closure closure) {
154:            }
155:
156:            public List step(int step) {
157:                return EMPTY_LIST;
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.