Source Code Cross Referenced for UnmodifiableLongList.java in  » Development » PCJ » bak » pcj » list » 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 » Development » PCJ » bak.pcj.list 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Primitive Collections for Java.
003:         *  Copyright (C) 2003  Søren Bak
004:         *
005:         *  This library is free software; you can redistribute it and/or
006:         *  modify it under the terms of the GNU Lesser General Public
007:         *  License as published by the Free Software Foundation; either
008:         *  version 2.1 of the License, or (at your option) any later version.
009:         *
010:         *  This library is distributed in the hope that it will be useful,
011:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         *  Lesser General Public License for more details.
014:         *
015:         *  You should have received a copy of the GNU Lesser General Public
016:         *  License along with this library; if not, write to the Free Software
017:         *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018:         */
019:        package bak.pcj.list;
020:
021:        import bak.pcj.util.Exceptions;
022:
023:        import bak.pcj.LongCollection;
024:        import bak.pcj.UnmodifiableLongCollection;
025:
026:        /**
027:         *  This class represents unmodifiable lists of long values.
028:         *
029:         *  @see        java.util.Collections#unmodifiableList(java.util.List)
030:         *
031:         *  @author     Søren Bak
032:         *  @version    1.1     24-08-2003 20:52
033:         *  @since      1.0
034:         */
035:        public class UnmodifiableLongList extends UnmodifiableLongCollection
036:                implements  LongList {
037:
038:            /**
039:             *  Creates a new unmodifiable list on an existing
040:             *  list. The result is a list whose elements and
041:             *  behaviour is the same as the existing list's except
042:             *  that the new list cannot be modified.
043:             *
044:             *  @param      l
045:             *              the existing list to make unmodifiable.
046:             *
047:             *  @throws     NullPointerException
048:             *              if <tt>l</tt> is <tt>null</tt>.
049:             */
050:            public UnmodifiableLongList(LongList l) {
051:                super (l);
052:            }
053:
054:            private LongList list() {
055:                return (LongList) collection;
056:            }
057:
058:            /**
059:             *  Throws <tt>UnsupportedOperationException</tt>.
060:             *
061:             *  @throws     UnsupportedOperationException
062:             *              unconditionally.
063:             */
064:            public void add(int index, long v) {
065:                Exceptions.unmodifiable("list");
066:            }
067:
068:            /**
069:             *  Throws <tt>UnsupportedOperationException</tt>.
070:             *
071:             *  @throws     UnsupportedOperationException
072:             *              unconditionally.
073:             */
074:            public boolean addAll(int index, LongCollection c) {
075:                Exceptions.unmodifiable("list");
076:                return false;
077:            }
078:
079:            public long get(int index) {
080:                return list().get(index);
081:            }
082:
083:            public int indexOf(long c) {
084:                return list().indexOf(c);
085:            }
086:
087:            /**
088:             *  @since      1.2
089:             */
090:            public int indexOf(int index, long c) {
091:                return list().indexOf(index, c);
092:            }
093:
094:            public int lastIndexOf(long c) {
095:                return list().lastIndexOf(c);
096:            }
097:
098:            /**
099:             *  @since      1.2
100:             */
101:            public int lastIndexOf(int index, long c) {
102:                return list().lastIndexOf(index, c);
103:            }
104:
105:            public LongListIterator listIterator() {
106:                return listIterator(0);
107:            }
108:
109:            public LongListIterator listIterator(int index) {
110:                final LongListIterator i = list().listIterator(index);
111:                return new LongListIterator() {
112:                    public boolean hasNext() {
113:                        return i.hasNext();
114:                    }
115:
116:                    public long next() {
117:                        return i.next();
118:                    }
119:
120:                    //  It is necessary to override remove() since we have
121:                    //  no way of knowing how iterators are implemented
122:                    //  in the underlying class.
123:                    public void remove() {
124:                        Exceptions.unmodifiable("list");
125:                    }
126:
127:                    public void add(long v) {
128:                        Exceptions.unmodifiable("list");
129:                    }
130:
131:                    public boolean hasPrevious() {
132:                        return i.hasPrevious();
133:                    }
134:
135:                    public int nextIndex() {
136:                        return i.nextIndex();
137:                    }
138:
139:                    public long previous() {
140:                        return i.previous();
141:                    }
142:
143:                    public int previousIndex() {
144:                        return i.previousIndex();
145:                    }
146:
147:                    public void set(long v) {
148:                        Exceptions.unmodifiable("list");
149:                    }
150:                };
151:            }
152:
153:            /**
154:             *  Throws <tt>UnsupportedOperationException</tt>.
155:             *
156:             *  @throws     UnsupportedOperationException
157:             *              unconditionally.
158:             */
159:            public long removeElementAt(int index) {
160:                Exceptions.unmodifiable("list");
161:                throw new RuntimeException();
162:            }
163:
164:            /**
165:             *  Throws <tt>UnsupportedOperationException</tt>.
166:             *
167:             *  @throws     UnsupportedOperationException
168:             *              unconditionally.
169:             */
170:            public long set(int index, long v) {
171:                Exceptions.unmodifiable("list");
172:                throw new RuntimeException();
173:            }
174:
175:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.