Source Code Cross Referenced for ChangeNotifyList.java in  » Swing-Library » InfoNode-Docking-Windows » net » infonode » util » 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 » Swing Library » InfoNode Docking Windows » net.infonode.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2004 NNL Technology AB
003:         * Visit www.infonode.net for information about InfoNode(R) 
004:         * products and how to contact NNL Technology AB.
005:         *
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License
008:         * as published by the Free Software Foundation; either version 2
009:         * of the License, or (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
019:         * MA 02111-1307, USA.
020:         */
021:
022:        // $Id: ChangeNotifyList.java,v 1.4 2005/02/16 11:28:14 jesper Exp $
023:        package net.infonode.util;
024:
025:        import java.util.*;
026:
027:        /**
028:         * @author $Author: jesper $
029:         * @version $Revision: 1.4 $
030:         */
031:        abstract public class ChangeNotifyList implements  List {
032:            private List list;
033:
034:            abstract protected void changed();
035:
036:            protected ChangeNotifyList() {
037:                this (new ArrayList(2));
038:            }
039:
040:            protected ChangeNotifyList(List list) {
041:                this .list = list;
042:            }
043:
044:            protected List getList() {
045:                return list;
046:            }
047:
048:            public int size() {
049:                return list.size();
050:            }
051:
052:            public boolean isEmpty() {
053:                return list.isEmpty();
054:            }
055:
056:            public Object[] toArray() {
057:                return list.toArray();
058:            }
059:
060:            public Object get(int index) {
061:                return list.get(index);
062:            }
063:
064:            public int indexOf(Object o) {
065:                return list.indexOf(o);
066:            }
067:
068:            public int lastIndexOf(Object o) {
069:                return list.lastIndexOf(o);
070:            }
071:
072:            public boolean contains(Object o) {
073:                return list.contains(o);
074:            }
075:
076:            public boolean containsAll(Collection c) {
077:                return list.containsAll(c);
078:            }
079:
080:            public Iterator iterator() {
081:                return listIterator();
082:            }
083:
084:            public ListIterator listIterator() {
085:                return listIterator(0);
086:            }
087:
088:            public ListIterator listIterator(int index) {
089:                return new ChangeIterator(list.listIterator(index));
090:            }
091:
092:            public Object[] toArray(Object[] a) {
093:                return list.toArray(a);
094:            }
095:
096:            public void clear() {
097:                list.clear();
098:                changed();
099:            }
100:
101:            public Object remove(int index) {
102:                Object result = list.remove(index);
103:                changed();
104:                return result;
105:            }
106:
107:            public void add(int index, Object element) {
108:                list.add(index, element);
109:                changed();
110:            }
111:
112:            public boolean add(Object o) {
113:                if (list.add(o)) {
114:                    changed();
115:                    return true;
116:                } else
117:                    return false;
118:            }
119:
120:            public boolean remove(Object o) {
121:                if (list.remove(o)) {
122:                    changed();
123:                    return true;
124:                } else
125:                    return false;
126:            }
127:
128:            public boolean addAll(int index, Collection c) {
129:                if (list.addAll(index, c)) {
130:                    changed();
131:                    return true;
132:                } else
133:                    return false;
134:            }
135:
136:            public boolean addAll(Collection c) {
137:                if (list.addAll(c)) {
138:                    changed();
139:                    return true;
140:                } else
141:                    return false;
142:            }
143:
144:            public boolean removeAll(Collection c) {
145:                if (list.removeAll(c)) {
146:                    changed();
147:                    return true;
148:                } else
149:                    return false;
150:            }
151:
152:            public boolean retainAll(Collection c) {
153:                if (list.retainAll(c)) {
154:                    changed();
155:                    return true;
156:                } else
157:                    return false;
158:            }
159:
160:            public List subList(int fromIndex, int toIndex) {
161:                return new ChangeNotifyList(list.subList(fromIndex, toIndex)) {
162:                    protected void changed() {
163:                        ChangeNotifyList.this .changed();
164:                    }
165:                };
166:            }
167:
168:            public Object set(int index, Object element) {
169:                Object result = list.set(index, element);
170:                changed();
171:                return result;
172:            }
173:
174:            private class ChangeIterator implements  ListIterator {
175:                private ListIterator iterator;
176:
177:                ChangeIterator(ListIterator iterator) {
178:                    this .iterator = iterator;
179:                }
180:
181:                public int nextIndex() {
182:                    return iterator.nextIndex();
183:                }
184:
185:                public int previousIndex() {
186:                    return iterator.previousIndex();
187:                }
188:
189:                public boolean hasPrevious() {
190:                    return iterator.hasPrevious();
191:                }
192:
193:                public Object previous() {
194:                    return iterator.previous();
195:                }
196:
197:                public void add(Object o) {
198:                    iterator.add(o);
199:                    changed();
200:                }
201:
202:                public void set(Object o) {
203:                    iterator.set(o);
204:                    changed();
205:                }
206:
207:                public void remove() {
208:                    iterator.remove();
209:                    changed();
210:                }
211:
212:                public boolean hasNext() {
213:                    return iterator.hasNext();
214:                }
215:
216:                public Object next() {
217:                    return iterator.next();
218:                }
219:            }
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.