Source Code Cross Referenced for CVSEntryVector.java in  » Source-Control » jcvsweb » com » ice » cvsc » 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 » Source Control » jcvsweb » com.ice.cvsc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         ** Java cvs client library package.
003:         ** Copyright (c) 1997-2002 by Timothy Gerard Endres
004:         ** 
005:         ** This program is free software.
006:         ** 
007:         ** You may redistribute it and/or modify it under the terms of the GNU
008:         ** Library General Public License (LGPL) as published by the Free Software
009:         ** Foundation.
010:         **
011:         ** Version 2 of the license should be included with this distribution in
012:         ** the file LICENSE.txt, as well as License.html. If the license is not
013:         ** included	with this distribution, you may find a copy at the FSF web
014:         ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the Free
015:         ** Software Foundation at 59 Temple Place - Suite 330, Boston, MA 02111 USA.
016:         **
017:         ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
018:         ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
019:         ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
020:         ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
021:         ** REDISTRIBUTION OF THIS SOFTWARE. 
022:         ** 
023:         */
024:
025:        package com.ice.cvsc;
026:
027:        import java.io.*;
028:        import java.lang.*;
029:        import java.util.*;
030:
031:        /**
032:         * The CVSEntryVector class subclasses Vector to specifically
033:         * handle CVSEntry ocjects. This subclass adds several convenience
034:         * methods for adding and retrieving CVSEntry objects quickly.
035:         *
036:         * @version $Revision: 2.3 $
037:         * @author Timothy Gerard Endres, <a href="mailto:time@ice.com">time@ice.com</a>.
038:         * @see CVSClient
039:         * @see CVSProject
040:         */
041:
042:        public class CVSEntryVector extends Vector {
043:            static public final String RCS_ID = "$Id: CVSEntryVector.java,v 2.3 2003/07/27 01:08:32 time Exp $";
044:            static public final String RCS_REV = "$Revision: 2.3 $";
045:
046:            static public boolean traceLocate = false;
047:            static public boolean traceLocatePath = false;
048:
049:            /**
050:             * Indicates if this entry vector is 'dirty'. If this
051:             * is true, then an entry was removed from this vector.
052:             * Since that entry can not indicate a dirty condition
053:             * because it is gone, we must record that state in the
054:             * vector itself. We also pick out the added entry case
055:             * in the event that the adder forgot to dirty the newly
056:             * added entry.
057:             */
058:            private boolean isDirty;
059:
060:            public CVSEntryVector() {
061:                super ();
062:                this .isDirty = false;
063:            }
064:
065:            public CVSEntryVector(int initCap) {
066:                super (initCap);
067:                this .isDirty = false;
068:            }
069:
070:            public CVSEntryVector(int initCap, int capIncr) {
071:                super (initCap, capIncr);
072:                this .isDirty = false;
073:            }
074:
075:            // UNDONE - finalize should removeAllEntries!!!
076:
077:            public void removeAllEntries() {
078:                // Since we can contain other CVSEntryVector, we
079:                // need to recurse on those to be sure all is freed!
080:                //
081:                for (int i = 0; i < this .size(); ++i) {
082:                    CVSEntry entry = this .entryAt(i);
083:                    if (entry.isDirectory()) {
084:                        entry.removeAllEntries();
085:                    }
086:                }
087:
088:                this .removeAllElements();
089:            }
090:
091:            public CVSEntry entryAt(int index) {
092:                return (CVSEntry) this .elementAt(index);
093:            }
094:
095:            public CVSEntry getEntryAt(int index) {
096:                return (CVSEntry) this .elementAt(index);
097:            }
098:
099:            public void appendEntry(CVSEntry entry) {
100:                this .addElement(entry);
101:                this .isDirty = true;
102:            }
103:
104:            private boolean removeEntry(CVSEntry entry) {
105:                boolean result;
106:
107:                result = this .removeElement(entry);
108:                if (result) {
109:                    this .isDirty = true;
110:                }
111:
112:                return result;
113:            }
114:
115:            private boolean removeEntry(String entryName) {
116:                for (int i = 0; i < this .size(); ++i) {
117:                    CVSEntry entry = this .entryAt(i);
118:
119:                    if (entryName.equals(entry.getName())) {
120:                        this .removeElementAt(i);
121:                        this .isDirty = true;
122:                        return true;
123:                    }
124:                }
125:
126:                return false;
127:            }
128:
129:            /**
130:             * Check to see if any entries in this vector are dirty.
131:             *
132:             * @return If any entry is dirty, returns true, else false.
133:             */
134:
135:            public boolean isDirty() {
136:                if (this .isDirty)
137:                    return true;
138:
139:                for (int i = 0; i < this .size(); ++i) {
140:                    CVSEntry entry = (CVSEntry) this .elementAt(i);
141:                    if (entry.isDirty())
142:                        return true;
143:                }
144:
145:                return false;
146:            }
147:
148:            /**
149:             * Check to see if any entries in this vector are dirty.
150:             *
151:             * @return If any entry is dirty, returns true, else false.
152:             */
153:
154:            public void setDirty(boolean dirty) {
155:                this .isDirty = dirty;
156:
157:                for (int i = 0; i < this .size(); ++i) {
158:                    CVSEntry entry = (CVSEntry) this .elementAt(i);
159:                    entry.setDirty(dirty);
160:                }
161:            }
162:
163:            /**
164:             * Locate an entry in this entry vector with the given name.
165:             *
166:             * @param name The entry's name (without any path).
167:             * @return The entry corresponding to name, or null if not found.
168:             */
169:
170:            public CVSEntry locateEntry(String name) {
171:                CVSTracer.traceIf(CVSEntryVector.traceLocate,
172:                        "===== CVSEntryVector.locateEntry: " + "name '" + name
173:                                + "' =====");
174:
175:                for (int i = 0; i < this .size(); ++i) {
176:                    CVSEntry entry = (CVSEntry) this .elementAt(i);
177:
178:                    CVSTracer.traceIf(CVSEntryVector.traceLocate,
179:                            "CVSEntryVector.locateEntry: ENTRY '"
180:                                    + entry.getFullName() + "' isDir '"
181:                                    + entry.isDirectory() + "'");
182:
183:                    if (name.equals(entry.getName())) {
184:                        CVSTracer.traceIf(CVSEntryVector.traceLocate,
185:                                "CVSEntryVector.locateEntry: '"
186:                                        + entry.getFullName() + "' FOUND.");
187:                        return entry;
188:                    }
189:                }
190:
191:                CVSTracer
192:                        .traceIf(CVSEntryVector.traceLocate,
193:                                "CVSEntryVector.locateEntry: '" + name
194:                                        + "' NOT FOUND.");
195:
196:                return null;
197:            }
198:
199:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.