Source Code Cross Referenced for SVNLogEntryPath.java in  » Source-Control » tmatesoft-SVN » org » tmatesoft » svn » core » 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 » tmatesoft SVN » org.tmatesoft.svn.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ====================================================================
003:         * Copyright (c) 2004-2008 TMate Software Ltd.  All rights reserved.
004:         *
005:         * This software is licensed as described in the file COPYING, which
006:         * you should have received as part of this distribution.  The terms
007:         * are also available at http://svnkit.com/license.html
008:         * If newer versions of this license are posted there, you may use a
009:         * newer version instead, at your option.
010:         * ====================================================================
011:         */
012:
013:        package org.tmatesoft.svn.core;
014:
015:        import java.io.Serializable;
016:
017:        /**
018:         * The <b>SVNLogEntryPath</b> class encapsulates information about a single 
019:         * item changed in a revision. This information includes an item's path, a 
020:         * type of the changes made to the item, and if the item is a copy of another
021:         * one - information about the item's ancestor. 
022:         * 
023:         * <p>
024:         * <b>SVNLogEntryPath</b> objects are held by an <b>SVNLogEntry</b> object - 
025:         * they are representations of all the changed paths in the revision represented
026:         * by that <b>SVNLogEntry</b> object.
027:         * 
028:         * @version 1.1.1
029:         * @author  TMate Software Ltd.
030:         * @see 	SVNLogEntry
031:         */
032:        public class SVNLogEntryPath implements  Serializable {
033:
034:            /**
035:             * Char <span class="javastring">'A'</span> (item added).
036:             */
037:            public static final char TYPE_ADDED = 'A';
038:
039:            /**
040:             * Char <span class="javastring">'D'</span> (item deleted).
041:             */
042:            public static final char TYPE_DELETED = 'D';
043:
044:            /**
045:             * Char <span class="javastring">'M'</span> (item modified).
046:             */
047:            public static final char TYPE_MODIFIED = 'M';
048:
049:            /**
050:             * Char <span class="javastring">'R'</span> (item replaced).
051:             */
052:            public static final char TYPE_REPLACED = 'R';
053:
054:            private String myPath;
055:            private char myType;
056:            private String myCopyPath;
057:            private long myCopyRevision;
058:
059:            /**
060:             * Constructs an <b>SVNLogEntryPath</b> object. 
061:             * 
062:             * <p>
063:             * Use char constants of this class as a change <code>type</code> to 
064:             * pass to this constructor. 
065:             *   
066:             * @param path				a path that was changed in a revision
067:             * @param type				a type of the path change; it can be one of the following: 
068:             *                          <span class="javastring">'M'</span> - Modified, <span class="javastring">'A'</span> - Added, 
069:             *                          <span class="javastring">'D'</span> - Deleted, <span class="javastring">'R'</span> - Replaced 
070:             * @param copyPath			the path of the ancestor of the item represented 
071:             *                          by <code>path</code> (in that case if <code>path</code> 
072:             *                          was copied), or <span class="javakeyword">null</span> if
073:             *                          <code>path</code>
074:             * @param copyRevision		the ancestor's revision if the <code>path</code> is a branch,
075:             * 							or -1 if not
076:             */
077:            public SVNLogEntryPath(String path, char type, String copyPath,
078:                    long copyRevision) {
079:                myPath = path;
080:                myType = type;
081:                myCopyPath = copyPath;
082:                myCopyRevision = copyRevision;
083:            }
084:
085:            /**
086:             * Returns the path of the ancestor of the item represented 
087:             * by this object.
088:             * 
089:             * @return	the origin path from where the item, represented by this
090:             *          object, was copied, or <span class="javakeyword">null</span> 
091:             *          if it wasn't copied
092:             */
093:            public String getCopyPath() {
094:                return myCopyPath;
095:            }
096:
097:            /**
098:             * Returns the revision of the ancestor of the item represented by this 
099:             * object.
100:             * 
101:             * @return	the revision of the origin path from where the item, 
102:             *          represented by this object, was copied, or -1 if the item
103:             *          was not copied
104:             */
105:            public long getCopyRevision() {
106:                return myCopyRevision;
107:            }
108:
109:            /**
110:             * Returns the path of the item represented by this object.
111:             * 
112:             * @return  the changed path represented by this object
113:             */
114:            public String getPath() {
115:                return myPath;
116:            }
117:
118:            /**
119:             * Gets the type of the change applied to the item represented by this
120:             * object. This type can be one of the following: 
121:             * <span class="javastring">'M'</span> - Modified, 
122:             * <span class="javastring">'A'</span> - Added, 
123:             * <span class="javastring">'D'</span> - Deleted,
124:             * <span class="javastring">'R'</span> - Replaced (what means that the 
125:             * object is first deleted, then another object of the same name is 
126:             * added, all within a single revision).
127:             * 
128:             * @return a type of the change as a char label
129:             */
130:            public char getType() {
131:                return myType;
132:            }
133:
134:            /**
135:             * Sets the path of the item represented by this object.
136:             * 
137:             * @param path a path of an item that was changed (regarding a definite
138:             *             revision)
139:             */
140:            public void setPath(String path) {
141:                myPath = path;
142:            }
143:
144:            protected void setChangeType(char type) {
145:                myType = type;
146:            }
147:
148:            protected void setCopyRevision(long revision) {
149:                myCopyRevision = revision;
150:            }
151:
152:            protected void setCopyPath(String path) {
153:                myCopyPath = path;
154:            }
155:
156:            /**
157:             * Calculates and returns a hash code for this object.
158:             * 
159:             * @return a hash code
160:             */
161:            public int hashCode() {
162:                final int PRIME = 31;
163:                int result = 1;
164:                result = PRIME * result
165:                        + ((myPath == null) ? 0 : myPath.hashCode());
166:                result = PRIME * result + myType;
167:                result = PRIME * result
168:                        + ((myCopyPath == null) ? 0 : myCopyPath.hashCode());
169:                result = PRIME * result
170:                        + (int) (myCopyRevision ^ (myCopyRevision >>> 32));
171:                return result;
172:            }
173:
174:            /**
175:             * Compares this object with another one.
176:             * 
177:             * @param  obj  an object to compare with
178:             * @return      <span class="javakeyword">true</span> 
179:             *              if this object is the same as the <code>obj</code> 
180:             *              argument
181:             */
182:            public boolean equals(Object obj) {
183:                if (this  == obj) {
184:                    return true;
185:                }
186:                if (obj == null || !(obj instanceof  SVNLogEntryPath)) {
187:                    return false;
188:                }
189:                final SVNLogEntryPath other = (SVNLogEntryPath) obj;
190:                return myCopyRevision == other.myCopyRevision
191:                        && myType == other.myType
192:                        && SVNLogEntry.compare(myPath, other.myPath)
193:                        && SVNLogEntry.compare(myCopyPath, other.myCopyPath);
194:            }
195:
196:            /**
197:             * Gives a string representation of this oobject.
198:             * 
199:             * @return a string representing this object
200:             */
201:            public String toString() {
202:                StringBuffer result = new StringBuffer();
203:                result.append(myType);
204:                result.append(' ');
205:                result.append(myPath);
206:                if (myCopyPath != null) {
207:                    result.append("(from ");
208:                    result.append(myCopyPath);
209:                    result.append(':');
210:                    result.append(myCopyRevision);
211:                    result.append(')');
212:                }
213:                return result.toString();
214:            }
215:
216:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.